useranon
useranon

Reputation: 29514

silly simple question in rails 3

i have a line in my model in rails 2

named_scope :ordered, lambda {|*args| {:order => (args.first || 'created_at DESC')} }

how to change this to rails3

Upvotes: 0

Views: 37

Answers (1)

Dylan Markow
Dylan Markow

Reputation: 124439

scope :ordered, lambda { |*args|
  order(args.first || 'created_at DESC')
}

Upvotes: 1

Related Questions