2011-01-25 76 views
0

我有一条线在我的模型导轨2在导轨3愚蠢的简单问题

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

如何改变这种到Rails3中

回答

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