In my Rails app have a default scope that looks like this:
default_scope order: \'external_updated_at DESC\'
I have now upgraded to Rails 4
You can also use the lambda
keyword. This is useful for multiline blocks.
default_scope lambda {
order(external_updated_at: :desc)
}
which is equivalent to
default_scope -> { order(external_updated_at: :desc) }
and
default_scope { order(external_updated_at: :desc) }
This is what worked for me:
default_scope { order(:created_at => :desc) }