Class: Mongoid::Fields::Serializable::TimeWithZone

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Fields::Serializable, Timekeeping
Defined in:
lib/mongoid/fields/serializable/time_with_zone.rb

Overview

Defines the behaviour for time with zone fields.

Instance Attribute Summary

Attributes included from Mongoid::Fields::Serializable

#default_val, #label, #localize, #name, #options

Instance Method Summary collapse

Methods included from Timekeeping

#convert_to_time, #deserialize, #serialize, #strip_milliseconds

Methods included from Mongoid::Fields::Serializable

#constraint, #deserialize, #eval_default, #localized?, #metadata, #object_id_field?, #serialize, #type, #versioned?

Instance Method Details

#cast_on_read?true

When reading the field do we need to cast the value? This holds true when times are stored or for big decimals which are stored as strings.

Examples:

Typecast on a read?

field.cast_on_read?

Returns:

  • (true)

    Date fields cast on read.

Since:

  • 2.1.0



19
# File 'lib/mongoid/fields/serializable/time_with_zone.rb', line 19

def cast_on_read?; true; end