diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-23 11:30:14 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-23 14:29:05 -0800 |
commit | 93d78b831831a1c8e324d4c5404b99e81fe77725 (patch) | |
tree | 7b9d090862c70cf097793b9826b0272edfcd967b /activerecord/lib/active_record | |
parent | 6a8f1b8b402b31ae43872c9d1f37b931c85799e7 (diff) | |
download | rails-93d78b831831a1c8e324d4c5404b99e81fe77725.tar.gz rails-93d78b831831a1c8e324d4c5404b99e81fe77725.tar.bz2 rails-93d78b831831a1c8e324d4c5404b99e81fe77725.zip |
fixing more dup tests
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/base.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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 |