Module: ActiveRecord::AttributeMethods::BeforeTypeCast

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_record/attribute_methods/before_type_cast.rb

Instance Method Summary collapse

Instance Method Details

#attributes_before_type_castObject

Returns a hash of attributes before typecasting and deserialization.



15
16
17
# File 'lib/active_record/attribute_methods/before_type_cast.rb', line 15

def attributes_before_type_cast
  Hash[attribute_names.map { |name| [name, read_attribute_before_type_cast(name)] }]
end

#read_attribute_before_type_cast(attr_name) ⇒ Object



10
11
12
# File 'lib/active_record/attribute_methods/before_type_cast.rb', line 10

def read_attribute_before_type_cast(attr_name)
  @attributes[attr_name]
end