Module: Mongoid::Extensions::Time
- Defined in:
- lib/mongoid/extensions/time.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- EPOCH =
Deprecated.
No longer used as a return value from #mongoize passed an invalid time string.
Constant for epoch - used when passing invalid times.
::Time.utc(1970, 1, 1, 0, 0, 0)
Instance Method Summary collapse
-
#__mongoize_time__ ⇒ Time
Mongoizes a Time into a time.
-
#mongoize ⇒ Time
Turn the object from the ruby type we deal with to a Mongo friendly type.
Instance Method Details
#__mongoize_time__ ⇒ Time
Mongoizes a Time into a time.
Time always mongoize into Time instances (which are themselves).
13 14 15 |
# File 'lib/mongoid/extensions/time.rb', line 13 def __mongoize_time__ self end |
#mongoize ⇒ Time
Turn the object from the ruby type we deal with to a Mongo friendly type.
30 31 32 |
# File 'lib/mongoid/extensions/time.rb', line 30 def mongoize ::Time.mongoize(self) end |