Module: Mongoid::Extensions::Time

Defined in:
lib/mongoid/extensions/time.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

EPOCH =

Constant for epoch - used when passing invalid times.

::Time.utc(1970, 1, 1, 0, 0, 0)

Instance Method Summary collapse

Instance Method Details

#mongoizeTime

Turn the object from the ruby type we deal with to a Mongo friendly type.

Examples:

Mongoize the object.

time.mongoize

Returns:

  • (Time)

    The object mongoized.

Since:

  • 3.0.0



18
19
20
# File 'lib/mongoid/extensions/time.rb', line 18

def mongoize
  ::Time.mongoize(self)
end