views:

32

answers:

2

I have a column, money, and I want the top 5 most expensive activeRecord items.

How do I do that?

+2  A: 
find(:all, order => "money desc" :limit => 5)
mark
+1  A: 

Rails 3 (ARel) syntax:

Item.order('items.money DESC').limit(5)
Jon Smock