diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/read.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/serialization.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/read.rb b/activerecord/lib/active_record/attribute_methods/read.rb index 69507b5838..788d671ad1 100644 --- a/activerecord/lib/active_record/attribute_methods/read.rb +++ b/activerecord/lib/active_record/attribute_methods/read.rb @@ -94,15 +94,15 @@ module ActiveRecord value = @attributes[attr_name] unless value.nil? if column = column_for_attribute(attr_name) - type_cast_attribute(column, value) + type_cast_attribute(column) else value end end end - def type_cast_attribute(column, value) #:nodoc: - column.type_cast(value) + def type_cast_attribute(column) #:nodoc: + column.type_cast(@attributes[column.name]) end private diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb index 001620d889..ac65ef94f9 100644 --- a/activerecord/lib/active_record/attribute_methods/serialization.rb +++ b/activerecord/lib/active_record/attribute_methods/serialization.rb @@ -64,7 +64,7 @@ module ActiveRecord end end - def type_cast_attribute(column, value) + def type_cast_attribute(column) coder = self.class.serialized_attributes[column.name] if column.text? && coder |