Ruby On Merging two sets of conditions

by erockenjew.myopenid.com, October 16, 2007 04:02

BTW, i know switching to ru...

0a3ce535ca2e42e3b6f7857b3f0b4bef Talk
1
2
DB[:users].filter(:country => "US").or("confirmed = ?", 1).filter("ids NOT IN (?)", [1, 10, 100])
#=> SELECT * FROM users WHERE country = 'US' OR confirmed = 1 AND ids NOT IN (1,10,100)

Ruby On Merging two sets of conditions

by erockenjew.myopenid.com, October 16, 2007 04:00

Or you could just switch to...

0a3ce535ca2e42e3b6f7857b3f0b4bef Talk
1
2
3
4
# used for building a conditions string for an ActiveRecord find
# 
# usage:
...

Ruby On Merging two sets of conditions

by erockenjew.myopenid.com, October 16, 2007 02:44 Star_fullStar_fullStar_fullStar_full

I wrote an extremely small ...

0a3ce535ca2e42e3b6f7857b3f0b4bef Talk