Skip to content

Dup reset timestamps #113

Closed
wants to merge 2 commits into from

3 participants

@franckverrot

The last changes in the CHANGELOG makes it clear that AR::Base.dup returns an object where new_record? is true. The attached patch clears the timestamps (if they exist) when calling dup. If we don't want that behavior though, we should document that dup preserves these AR-managed attributes.

In any case we should also close/mark as invalid that ticket AR::Clone does not clear out timestamps

@fxn
Ruby on Rails member
fxn commented Nov 24, 2010

I think the docs should also mention the details about callbacks.

@tenderlove
Ruby on Rails member

@cesario perfect, thanks. I will apply this.

@fxn Not sure where we document this stuff. The behavior of dup is basically what clone used to do. If we documented clone somewhere, we need to change it to say "dup".

@franckverrot

Here's another pull request documenting the dup behavior, and fixing the typo.
#114

Thanks!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.