Module: Mongoid::Extensions::Date
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/mongoid/extensions/date.rb |
Overview
Adds type-casting behavior to Date
class.
Instance Method Summary
-
#__mongoize_time__ ⇒ Time | ActiveSupport::TimeWithZone
Convert the date 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 | ActiveSupport::TimeWithZone
Convert the date into a time.
# File 'lib/mongoid/extensions/date.rb', line 19
def __mongoize_time__ ::Time.zone.local(year, month, day) end
#mongoize ⇒ Time
Turn the object from the ruby type we deal with to a Mongo friendly type.