Active record taking Date.today as yesterday
- by Mongus Pong
I have a strange one..
I am doing something like :
tip = find (:first, :conditions => ["last_shown = ? or last_shown is null", Date.today])
And then a little later on I do :
tip.last_shown = Date.today
tip.save
When I look at output of these queries, ActiveRecord is doing the first query with todays date as I would expect.
However, the send query, ActiveRecord is setting the last_shown date to be yesterdays date.
Why on earth would it do this?
I have
config.time_zone = 'UTC'
in my environment.rb. I can use Time.now.utc.to_date instead of Date.today but it makes no difference.