D. Krmpotic wrote:
Post.find(:all, :conditions => ["has_been_read = ?, nil])
Post.find(:all, :conditions => [“has_been_read IS NULL”])
That will work.
Unless you’re keeping some other kind of data in that column, though,
you might prefer use a migration to change it to boolean, default false:
change_column :<table_name>, :has_been_read, :boolean, :default => false
This way, you can say
Post.find(:all, :conditions => ["has_been_read = ?, false])
And in your model, put something like
Then you just call @thing.mark_as_read when it’s read, and you should
have everything you need.