Closed eprothro closed 9 years ago
I amended the commit in preference of the Active Support's more robust in_time_zone
any thoughts on this?
@eprothro I've played around a bit with this and I was seeing some inconsistent behavior with this change. I'm going to poke around again and see what I can figure out.
My understanding is that an Active Record date_time accessors are time zone aware, returning the object configured with the current time zone (e.g. not the system time). If I'm wrong there, just let me know.
Migrating to this gem with existing data (e.g replacing field
foo_at
that was an Active Record date_time type field with an hstore_accessor attribute withdata_type: :time
resulted in unexpected behavior, where the returned object is now initialized with the zone of the system clock.Before migration to hstore
After migration to hstore
The change in this PR fixes this, such that the ActiveSupport timezone is respected.
If you think this is the right direction, I'd love your thoughts about the robustness of this change, and how to best integrate that with the test suite.