Module: Mongoid::Extensions::TimeWithZone::ClassMethods
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Extended In:
| |
Defined in: | lib/mongoid/extensions/time_with_zone.rb |
Instance Method Summary
-
#demongoize(object) ⇒ TimeWithZone
Convert the object from its mongo friendly ruby type to this type.
-
#mongoize(object) ⇒ Time
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#demongoize(object) ⇒ TimeWithZone
Convert the object from its mongo friendly ruby type to this type.
# File 'lib/mongoid/extensions/time_with_zone.rb', line 55
def demongoize(object) ::Time.demongoize(object).try(:in_time_zone) end
#mongoize(object) ⇒ Time
Turn the object from the ruby type we deal with to a Mongo friendly type.