Parent

Methods

Class/Module Index [+]

Quicksearch

Mongoid::Fields::Serializable::DateTime

Defines the behaviour for date time fields.

Public Instance Methods

deserialize(object) click to toggle source

Deserialize this field from the type stored in MongoDB to the type defined on the model.

@example Deserialize the field.

field.deserialize(object)

@param [ Object ] object The object to cast.

@return [ DateTime ] The converted date time.

@since 2.1.0

# File lib/mongoid/fields/serializable/date_time.rb, line 21
def deserialize(object)
  object.try(:to_datetime)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.