views:

22

answers:

1

I would like to specify a default sort order in my model.

So that when I preform a find(:all, ...) without an :order parameter it defaults to the order specified in the model, but specifying an :order will override the default.

+1  A: 

You can use default_scope: http://api.rubyonrails.org/classes/ActiveRecord/Base.html#M001828

Slobodan Kovacevic