This project is archived and is in readonly mode.
ActiveRecord::Base#dup is now gone?
Reported by azimux | August 20th, 2008 @ 11:56 PM | in 2.x
I see this method in ActiveResource::Base but not ActiveRecord::Base
When I call dup on an active record object I wind up with
b = a.dup
b == a #true
because b and a have the same id, which is not how the documentation says ActiveRecord::Base#dup works
Comments and changes to this ticket
-
Frederick Cheung August 21st, 2008 @ 02:02 AM
They have the same id in that they correspond to the same database row but they are different objects (check their object_id). Are you thinking of clone ?
-
azimux August 21st, 2008 @ 02:40 AM
- Tag cleared.
Oh, it looks like ActiveRecord::Base never had a dup method, nevermind.
I should indeed be using clone, thanks Frederick
This ticket can be closed
-
Pratik August 21st, 2008 @ 11:15 AM
- State changed from new to invalid
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>