Rails ActiveRecord conditions

Posted by xpepermint on Stack Overflow See other posts from Stack Overflow or by xpepermint
Published on 2010-02-25T12:38:10Z Indexed on 2010/05/12 22:44 UTC
Read the original article Hit count: 262

Is there a way to create a condition like this?

@products = Product.find(:all,
  :limit => 5,
  :conditions => { :products => { :locale => 'en', :id NOT '1' }, :tags => { :name => ['a','b']})

I would like to list all products not including product 1. Thx.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activerecord