Class Mongoid::Fields::Serializable::Date
In: lib/mongoid/fields/serializable/date.rb
Parent: Object

Defines the behaviour for date fields.

Methods

Included Modules

Serializable Timekeeping

Public Instance methods

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 [ Date ] The converted date.

@since 2.1.0

Protected Instance methods

Converts the date to a time to persist.

@example Convert the date to a time.

  Date.convert_to_time(date)

@param [ Date ] value The date to convert.

@return [ Time ] The date converted.

@since 2.1.0

[Validate]