Rails 3.2.1
Is there a way (without squeel ) to use the ActiveRecord hash syntax to build the != Operator?
Something like Product.where(id: !params[:id])
Creates SELECT products.* FROM products WHERE id != 5
Looking for the opposite of Product.where(id: params[:id])
UPDATE
In rails 4 there is a not operator.
Product.where.not(id: params[:id])
ruby-on-rails activerecord
Tyler DeWitt Aug 29 '12 at 19:01 2012-08-29 19:01
source share