Browse files

Remove incorrect comment regarding #initialize_copy

Comment added in #3164 is incorrect after reading

Signed-off-by: José Valim <>
  • Loading branch information...
1 parent 49f52c3 commit 4a0a640d33e1c729d38c6091bb1394fbda059b5c @paulgillard paulgillard committed with josevalim Jun 23, 2010
Showing with 0 additions and 8 deletions.
  1. +0 −8 activerecord/lib/active_record/base.rb
8 activerecord/lib/active_record/base.rb
@@ -1413,14 +1413,6 @@ def initialize(attributes = nil)
# as it copies the object's attributes only, not its associations. The extent of a "deep" clone is
# application specific and is therefore left to the application to implement according to its need.
def initialize_copy(other)
- # Think the assertion which fails if the after_initialize callback goes at the end of the method is wrong. The
- # deleted clone method called new which therefore called the after_initialize callback. It then went on to copy
- # over the attributes. But if it's copying the attributes afterwards then it hasn't finished initializing right?
- # For example in the test suite the topic model's after_initialize method sets the author_email_address to
- # I would have thought this would mean that all cloned models would have an author email address
- # of However the test_clone test method seems to test that this is not the case. As a result the
- # after_initialize callback has to be run *before* the copying of the attributes rather than afterwards in order
- # for all tests to pass. This makes no sense to me.
callback(:after_initialize) if respond_to_without_attributes?(:after_initialize)
cloned_attributes = other.clone_attributes(:read_attribute_before_type_cast)

0 comments on commit 4a0a640

Please sign in to comment.