diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-29 20:48:43 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-29 20:48:43 -0200 |
commit | 5977e7e4d534463c53af1acef960bccade8c8ecc (patch) | |
tree | be7fbda9ec8d6fc8b048baf4a2df99b740689406 /activerecord/lib/active_record/attribute_methods | |
parent | 6bc179075d95030cee4c143b472345fa7f12b1b9 (diff) | |
download | rails-5977e7e4d534463c53af1acef960bccade8c8ecc.tar.gz rails-5977e7e4d534463c53af1acef960bccade8c8ecc.tar.bz2 rails-5977e7e4d534463c53af1acef960bccade8c8ecc.zip |
Aesthetic
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/serialization.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb index 93e3ca8000..67abbbc2a0 100644 --- a/activerecord/lib/active_record/attribute_methods/serialization.rb +++ b/activerecord/lib/active_record/attribute_methods/serialization.rb @@ -76,7 +76,6 @@ module ActiveRecord end class Attribute < Struct.new(:coder, :value, :state) # :nodoc: - def unserialized_value(v = value) state == :serialized ? unserialize(v) : value end @@ -167,12 +166,12 @@ module ActiveRecord end def attributes_for_coder - attribute_names.each_with_object({}) do |name,attrs| + attribute_names.each_with_object({}) do |name, attrs| attrs[name] = if self.class.serialized_attributes.include?(name) - @attributes[name].serialized_value - else - read_attribute(name) - end + @attributes[name].serialized_value + else + read_attribute(name) + end end end end |