From 93734629a33591486b76e3b9884ea37650934eef Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Fri, 30 May 2014 13:06:05 -0700 Subject: Don't change values in `@raw_attributes` during serialization During `init_with`, the attributes given to the coder will be placed into `@raw_attributes`. As such, we should read from `@raw_attributes` when encoding, rather than `@attributes`, which has been type cast. --- activerecord/lib/active_record/attribute_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 fb6473b7c7..d2a8006069 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -289,7 +289,7 @@ module ActiveRecord # Placeholder so it can be overriden when needed by serialization def attributes_for_coder # :nodoc: - attributes + attributes_before_type_cast end # Returns an #inspect-like string for the value of the -- cgit v1.2.3