This project is archived and is in readonly mode.
Time.zone.today returns Date instead of ActiveSupport::TimeWithZone
-
Ryan Felton
+1
-
Andrew White
You can however do Time.zone.now.beginning_of_day, which is what Time.zone.today would likely be if it returned an ActiveSupport::TimeWithZone instance.
-
Kyle J. Ginavan
I missing something here. Within my 2.3.3 application I have a test that compares two reports. I pull it using sql/ActiveRecord::Base.connection.select_value with Time.zone.now.beginning_of_year.utc then compare to a report using pure active record and Time.zone.now.beginning_of_year. All is well.
Whenever I try to upgrade to 2.3.4 or 2.3.5 this breaks and I'm unable to put my finger on the issue or how the heck to fix. This is why I +1'd this ticket. Anyone have any insights?
-
Andrew White
You could use the Github compare view to look for any commits that might have affected your reports: http://github.com/rails/rails/compare/v2.3.3...v2.3.4 and http://github.com/rails/rails/compare/v2.3.4...v2.3.5
There are a couple of commits to do with date/time calculation that could be affecting you.