Topic: rails 3 advanced queries

In one of my queries I used .where (:categories => {item_categories {:item_category_id => nil}} for 'item_category_id IS NULL'. How to write a similar query for 'item_category_id IS NOT NULL' ?

Last edited by rashila (2012-06-11 23:17:50)

Re: rails 3 advanced queries

Did you try

.where (:categories => {item_categories {'item_category_id IS NOT NULL'}}