It's hard for me to understand this, but how can I say that the finder instruction ignores the time of the Datetime field in db?
def trips_leaving_in_two_weeks Trip.find(:all, :conditions => ["depart_date = ?", 2.weeks.from_now.to_date]) end
I want date_date to be returned as soon as the date, but it also returns the time and prevents this equality from working. Is there anything that can be compared with dates? Thanks
Edit
Here the code I'm using now works:
Trip.find(:all, :conditions => ["DATE(depart_date) = ?", 2.weeks.from_now.to_date])
sql ruby-on-rails activerecord
Calebhc
source share