I’m trying (and failing) to construct a find all statement with conditions in rails for what I need. I need to find all the values where where the ‘in’ value in a table is greater than 0 (or just not zero would be fine) but I am having trouble with this, here’s what I need:
@sales = Transaction.find(:all, :conditions => {:in => 'greater than 0'} )
Is there a simple way to do this?
Thanks,
Tom
You can use Arel to do this without having to reach into SQL: