Jikku Jose
Jikku Jose

Reputation: 18804

Sequel way of selecting all records of specific date

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

Answers (1)

aelor
aelor

Reputation: 11116

Use:

Post.where(:created_at => (date.beginning_of_day..date.end_of_day))

where date is the Date object

Upvotes: 1

Related Questions