you are here: codestackercodes [RSS]use default_scope to set up default find conditions such as order

use default_scope to set up default find conditions such as order

class MyModel < ActiveRecord::Base
  default_scope :order => 'created_at desc'
end

Comments