From 93d78b831831a1c8e324d4c5404b99e81fe77725 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 23 Nov 2010 11:30:14 -0800 Subject: fixing more dup tests --- activerecord/lib/active_record/base.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 6f0e71cc7b..f9de4b7918 100644 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1598,20 +1598,20 @@ MSG # to its need. def initialize_dup(other) super + _run_after_initialize_callbacks if respond_to?(:_run_after_initialize_callbacks) cloned_attributes = other.clone_attributes(:read_attribute_before_type_cast) cloned_attributes.delete(self.class.primary_key) @attributes = cloned_attributes @changed_attributes = other.changed_attributes.dup - @attributes_cache = {} - @persisted = false - _run_after_initialize_callbacks if respond_to?(:_run_after_initialize_callbacks) clear_aggregation_cache clear_association_cache + @attributes_cache = {} + @persisted = false + ensure_proper_type populate_with_current_scope_attributes - self end # Returns +true+ if the record is read only. Records loaded through joins with piggy-back -- cgit v1.2.3