I have a table of deals and need to find records where the date matches today\'s date.
From the rails console, the date field I need to match looks like this. I\'ve assi
Rails 5.1 has introduced Date#all_day helper, which returns a range object for a given date, so you can just write:
Date#all_day
Deal.where(start: Date.today.all_day)
You can also use SQL DATE() function for your goal, e.g.:
DATE()
@deals = Deal.where('DATE(start) = ?', Date.today)