ActiveRecord has a very neat syntax for querying records where a column is equal to any value in a given array:
For a simple example, let's say you have 10 products with ids 1,2,3,4,5,6,7,8,9,10.
Product.where(id: [2,3,4,5,6])
will return products 2,3,4,5 and 6.
Is there an ActiveRecord equivalent for querying products where the column does not equal any value in an array?
Something like:
Product.where('id != ?', [2,3,4,5,6])
except that it actually works...
And when you pass it [2,3,4,5,6] in this case, it will return products 1,7,8,9 and 10.
EDIT
I need a Rails 3 solution!!!