Class: ActiveRecord::TypeCaster::Map
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | activerecord/lib/active_record/type_caster/map.rb |
Class Method Summary
- .new(klass) ⇒ Map constructor
Instance Attribute Summary
- #klass readonly private
Instance Method Summary
Constructor Details
.new(klass) ⇒ Map
Instance Attribute Details
#klass (readonly, private)
[ GitHub ]# File 'activerecord/lib/active_record/type_caster/map.rb', line 20
attr_reader :klass
Instance Method Details
#type_cast_for_database(attr_name, value)
[ GitHub ]# File 'activerecord/lib/active_record/type_caster/map.rb', line 10
def type_cast_for_database(attr_name, value) type = type_for_attribute(attr_name) type.serialize(value) end
#type_for_attribute(name)
[ GitHub ]# File 'activerecord/lib/active_record/type_caster/map.rb', line 15
def type_for_attribute(name) klass.type_for_attribute(name) end