Skip to content

Default sort order should use primary_key (not id) #235

Description

@gregbell

Currently, if you customize the primary key in an Active Record object, the sorting will raise an exception.

Instead of using a global #default_sort_order, it should get one from the model

  # lib/active_admin/resource.rb
    def default_options
      {
        :namespace  => ActiveAdmin.application.default_namespace,
        :sort_order => ActiveAdmin.application.default_sort_order
      }
    end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions