开发者

Why can't I use order in find method?

In script/console

Storage.find(:all , :conditions => "item_id=1" , order => "expire_date DESC")

I get

NameError: undefined local variable or method `order' for #<Object:0xb7761954>
    from (开发者_运维问答irb):5

But it works when I use

Storage.find(:all , :conditions => "item_id=1")


order should be a symbol, :order => "expire_date DESC"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜