Sha256: 39ef9ba72d4796f3ed7b3255b3ffaa8e5cd796972d355ea3b1da461b20bc1f6a
Contents?: true
Size: 705 Bytes
Versions: 161
Compression:
Stored size: 705 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Fields #:nodoc: module Internal #: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) super(object).try(:to_datetime) end end end end end
Version data entries
161 entries across 69 versions & 3 rubygems