gregbell/active_admin — Issue #944: Can't change ordering because of default order by categories.id desc
Author: mrplum
Created: 2012-01-27 15:23:05+00:00
State: open

I have a category model like below:
```
class Category <
# ...
scope :by_position, order('position asc, created_at desc')
scope :only_parent, by_position.where("parent_id is null")
end
```

and have regitered category as:

```
ActiveAdmin.register Category do
scope :all
scope :only_parent, :default => true
index do
# ...
end
#...
end
```

I want to order by position but it looks like ActiveAdmin appends own ordering string to query.

SELECT "categories".* FROM "categories" WHERE (parent_id is null) ORDER BY "categories".id desc, position asc, created_at desc