I'm working on an event system where admins can select events to feature and add promotional text. As they need to add additional text the featured events are in their own table and reference the event details.
I'm now trying to output featured events for each day in the next week. Simplified example:
day = DateTime.now.to_date
featured_events = @featured_events.where('event.start_datetime = ?', day)
The problem is that start_datetime
is in datetime format and day
is in date format so it always outputs nothing. Is it possible to compare these two values with .where()
?
Thanks!