module Mongoid::Extensions::DateTime

def __mongoize_time__

Returns:
  • (Time | ActiveSupport::TimeWithZone) - The mongoized time.

Other tags:
    Example: Mongoize the date time. -
def __mongoize_time__
  if Mongoid.use_activesupport_time_zone?
    in_time_zone(::Time.zone)
  else
    time = to_time
    time.respond_to?(:getlocal) ? time.getlocal : time
  end
end

def mongoize

Returns:
  • (Time) - The object mongoized.

Other tags:
    Example: Mongoize the object. -
def mongoize
  ::DateTime.mongoize(self)
end