Class: ActiveRecord::Type::Time
- Inherits:
-
ActiveModel::Type::Time
- Object
- ActiveModel::Type::Value
- ActiveModel::Type::Time
- ActiveRecord::Type::Time
- Includes:
- Internal::Timezone
- Defined in:
- activerecord/lib/active_record/type/time.rb
Defined Under Namespace
Classes: Value
Instance Attribute Summary
Attributes inherited from ActiveModel::Type::Value
Instance Method Summary collapse
Methods included from Internal::Timezone
#default_timezone, #initialize, #is_utc?
Methods inherited from ActiveModel::Type::Time
#type, #user_input_in_time_zone
Methods included from ActiveModel::Type::Helpers::TimeValue
#apply_seconds_precision, #type_cast_for_schema, #user_input_in_time_zone
Methods included from ActiveModel::Type::Helpers::Timezone
Methods inherited from ActiveModel::Type::Value
#==, #as_json, #assert_valid_value, #binary?, #cast, #changed?, #changed_in_place?, #deserialize, #force_equality?, #hash, #initialize, #map, #mutable?, #serializable?, #serialized?, #type, #type_cast_for_schema, #value_constructed_by_mass_assignment?
Methods included from ActiveModel::Type::SerializeCastValue
included, #initialize, #itself_if_serialize_cast_value_compatible, serialize
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included, #prepend_features, #prepended
Instance Method Details
#serialize(value) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'activerecord/lib/active_record/type/time.rb', line 11 def serialize(value) case value = super when ::Time Value.new(value) else value end end |
#serialize_cast_value(value) ⇒ Object
:nodoc:
20 21 22 |
# File 'activerecord/lib/active_record/type/time.rb', line 20 def serialize_cast_value(value) # :nodoc: Value.new(super) if value end |