diff options
author | itzki <itzki.h@gmail.com> | 2012-12-07 04:30:00 +0900 |
---|---|---|
committer | itzki <itzki.h@gmail.com> | 2012-12-10 14:44:24 +0900 |
commit | 7efcc5d72fb7e42358b4cb9b7f627e1a69c20911 (patch) | |
tree | e7fe33d158296dab746fa2899ae9e0f0e73b749c /activerecord/lib/active_record/model_schema.rb | |
parent | 9e42cd86869dcc158b0321b2d2dfcc185a7d0282 (diff) | |
download | rails-7efcc5d72fb7e42358b4cb9b7f627e1a69c20911.tar.gz rails-7efcc5d72fb7e42358b4cb9b7f627e1a69c20911.tar.bz2 rails-7efcc5d72fb7e42358b4cb9b7f627e1a69c20911.zip |
Fix decorating columns for serialized attributes
Diffstat (limited to 'activerecord/lib/active_record/model_schema.rb')
-rw-r--r-- | activerecord/lib/active_record/model_schema.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index 628ab0f566..85fb4be992 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -224,11 +224,10 @@ module ActiveRecord def decorate_columns(columns_hash) # :nodoc: return if columns_hash.empty? - serialized_attributes.each_key do |key| - columns_hash[key] = AttributeMethods::Serialization::Type.new(columns_hash[key]) - end - columns_hash.each do |name, col| + if serialized_attributes.key?(name) + columns_hash[name] = AttributeMethods::Serialization::Type.new(col) + end if create_time_zone_conversion_attribute?(name, col) columns_hash[name] = AttributeMethods::TimeZoneConversion::Type.new(col) end |