diff options
Diffstat (limited to 'activerecord/lib/active_record')
-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 |