Reputation: 18804
What's the best way to select all records of a specific date in Sequel ignoring the time?
Writing a where clause with range from the day's 0 to 23:59 seems to unlike it. Any other way to do?
Upvotes: 2
Views: 1963
Reputation: 11116
Use:
Post.where(:created_at => (date.beginning_of_day..date.end_of_day))
where date is the Date object
Upvotes: 1