aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-11-23 11:30:14 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-23 14:29:05 -0800
commit93d78b831831a1c8e324d4c5404b99e81fe77725 (patch)
tree7b9d090862c70cf097793b9826b0272edfcd967b /activerecord/lib/active_record/base.rb
parent6a8f1b8b402b31ae43872c9d1f37b931c85799e7 (diff)
downloadrails-93d78b831831a1c8e324d4c5404b99e81fe77725.tar.gz
rails-93d78b831831a1c8e324d4c5404b99e81fe77725.tar.bz2
rails-93d78b831831a1c8e324d4c5404b99e81fe77725.zip
fixing more dup tests
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb8
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