Permalink
Browse files

Update docs for AR::Base#clone.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3309268 commit 80b8b76091f680e4a4714ef8ec8458745a6f9388 @jeremy jeremy committed Nov 10, 2005
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/base.rb
@@ -1247,7 +1247,11 @@ def destroy
freeze
end
- # Returns a clone of the record that hasn't been assigned an id yet and is treated as a new record.
+ # Returns a clone of the record that hasn't been assigned an id yet and
+ # is treated as a new record. Note that this is a "shallow" clone:
+ # 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 clone
attrs = self.attributes_before_type_cast
attrs.delete(self.class.primary_key)

0 comments on commit 80b8b76

Please sign in to comment.