aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-29 20:48:43 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-29 20:48:43 -0200
commit5977e7e4d534463c53af1acef960bccade8c8ecc (patch)
treebe7fbda9ec8d6fc8b048baf4a2df99b740689406 /activerecord/lib/active_record/attribute_methods
parent6bc179075d95030cee4c143b472345fa7f12b1b9 (diff)
downloadrails-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.rb11
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