Sha256: 968274f40b5637fdff931bb37563edb2ab7822960e5f88bc84053cf0f687df02
Contents?: true
Size: 702 Bytes
Versions: 24
Compression:
Stored size: 702 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Fields #:nodoc: module Serializable #:nodoc: # Defines the behaviour for date time fields. class DateTime include Serializable include Timekeeping # 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 def deserialize(object) object.try(:to_datetime) end end end end end
Version data entries
24 entries across 24 versions & 2 rubygems