From 410e887a446e82399cca535bc0a9f12647d7dbf3 Mon Sep 17 00:00:00 2001 From: Nikita Afanasenko Date: Sat, 10 Nov 2012 01:45:43 +0400 Subject: Keep the code related to serialization in Serialization module. We should not need any `serialized_attributes` checks outside `ActiveRecord::AttributeMethods::Serialization` module. --- activerecord/lib/active_record/attribute_methods.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'activerecord/lib/active_record/attribute_methods.rb') diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 437fd00948..e0bfdb8f3e 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -369,14 +369,10 @@ module ActiveRecord end def typecasted_attribute_value(name) - if self.class.serialized_attributes.include?(name) - @attributes[name].serialized_value - else - # FIXME: we need @attributes to be used consistently. - # If the values stored in @attributes were already typecasted, this code - # could be simplified - read_attribute(name) - end + # FIXME: we need @attributes to be used consistently. + # If the values stored in @attributes were already typecasted, this code + # could be simplified + read_attribute(name) end end end -- cgit v1.2.3