Mongoize the date time into a time.
@example Mongoize the date time.
date_time.__mongoize_time__
@return [ Time ] The mongoized time.
@since 3.0.0
# File lib/mongoid/extensions/date_time.rb, line 13 def __mongoize_time__ return self if utc? && Mongoid.use_utc? if Mongoid.use_activesupport_time_zone? in_time_zone(::Time.zone) else time = to_time time.respond_to?(:getlocal) ? time.getlocal : time end end
Turn the object from the ruby type we deal with to a Mongo friendly type.
@example Mongoize the object.
date_time.mongoize
@return [ Time ] The object mongoized.
@since 3.0.0
# File lib/mongoid/extensions/date_time.rb, line 32 def mongoize ::DateTime.mongoize(self) end
Generated with the Darkfish Rdoc Generator 2.