I'm trying to figure out how to pull all the records in my set where their fields publish is true and expires is less than today. I have the following but I don't think the less than part is working, can someone please point me on the right track?
publish
expires
Announcement.where(publish: true, :expires < Date.today)
Thanks in advance for your help
Try this:
Announcement.where("publish = ? AND expires < ?", true, Date.today)
1.4m articles
1.4m replys
5 comments
56.9k users