activerecord search conditions - looking for null or false

Posted by Daniel on Stack Overflow See other posts from Stack Overflow or by Daniel
Published on 2009-09-26T15:36:23Z Indexed on 2010/04/01 16:33 UTC
Read the original article Hit count: 205

Filed under:
|

When doing a search in active record I'm looking for record's that do not have an archived bit set to true.

Some of the archived bits are null (which are not archived) others have archived set to false.

Obviously,

Project.all(:conditions => {:archived => false})

misses the projects with the archived bits with null values. How can all non-archived projects be selected wtih active record?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activerecord