Document the behavior of the dup method: does not preserve timestamps

This commit is contained in:
Franck Verrot 2010-11-25 02:54:59 +08:00 committed by Aaron Patterson
parent 7b77a1fc71
commit 7f8ce38b0d
1 changed files with 1 additions and 0 deletions

View File

@ -1605,6 +1605,7 @@ MSG
# only, not its associations. The extent of a "deep" copy is application
# specific and is therefore left to the application to implement according
# to its need.
# The dup method does not preserve the timestamps (created|updated)_(at|on).
def initialize_dup(other)
cloned_attributes = other.clone_attributes(:read_attribute_before_type_cast)
cloned_attributes.delete(self.class.primary_key)