-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
Minor Change
Mongoid currently uses Time.now or Time.now.utc for setting timestamps:
lib/mongoid/timestamps/created.rb: time = Time.now.utc lib/mongoid/timestamps/updated.rb: self.updated_at = Time.now.utc unless updated_at_changed? lib/mongoid/touchable.rb: current = Time.now
This is counter to our documentation (https://www.mongodb.com/docs/mongoid/master/reference/configuration/#time-zones) in which we recommend using Time.zone.now.
I think Time.zone.now is the correct usage (I also don't understand the reason for explicit conversion to UTC).