I want to get all records where the created_at field is less than today (a date). Is there anything like:
MyTable.find_by_created_at(< 2.days.ago)
Using ActiveRecord the standard way:
MyModel.where("created_at < ?", 2.days.ago)
Using the underlying Arel interface:
MyModel.where(MyModel.arel_table[:created_at].lt(2.days.ago))
Using a thin layer over Arel:
MyModel.where(MyModel[:created_at] < 2.days.ago)
Using squeel:
MyModel.where { created_at < 2.days.ago }