module Mongoid::Extensions::TimeWithZone

Public Instance Methods

__mongoize_time__() click to toggle source

Mongoizes an ActiveSupport::TimeWithZone into a time.

TimeWithZone always mongoize into TimeWithZone instances (which are themselves).

@return [ ActiveSupport::TimeWithZone ] self.

@since 3.0.0

# File lib/mongoid/extensions/time_with_zone.rb, line 16
def __mongoize_time__
  self
end
mongoize() click to toggle source

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/time_with_zone.rb, line 29
def mongoize
  ::ActiveSupport::TimeWithZone.mongoize(self)
end