How to specify a less than today condition on a date in Rails ActiveRecord

Try this:

Announcement.where("publish = ? AND expires < ?", true, Date.today)

Leave a Comment