Skip to content

Commit

Permalink
Document the behavior of the dup method: does not preserve timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
franckverrot committed Nov 24, 2010
1 parent 3702325 commit e1e227c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,7 @@ def dup # :nodoc:
# 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)
Expand Down

0 comments on commit e1e227c

Please sign in to comment.