I found out that using where with symbol :my_id => nil and using old school one with ? is different. Could anyone explain me why?
MyTable.where(\"my_id = ? \", n
I suppose it's so called "rails magic" you can pass ranges
Client.where(:created_at => (Time.now.midnight - 1.day)..Time.now.midnight)
becomes
SELECT * FROM clients WHERE (clients.created_at BETWEEN '2008-12-21 00:00:00'
AND '2008-12-22 00:00:00')
or if you pass a subset
Client.where(:orders_count => [1,3,5])
rails will do
SELECT * FROM clients WHERE (clients.orders_count IN (1,3,5))
more