This project is archived and is in readonly mode.

#93 ✓stale
Xavier Noria

Restore timestamps in model rollback

Reported by Xavier Noria | May 2nd, 2008 @ 03:12 AM

The current implementation of rollback_active_record_state! does some housekeeping like restoring @new_record. If you rollback a model after it was once saved like this

dev.rollback_active_record_state! do
  Developer.transaction do
    dev.save
    # other stuff that may raise an exception
  end
end

you may end up with a new_record? that has an initialized created_at for example.

This patch fixes that for timestamps.

Comments and changes to this ticket

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>

Referenced by

Pages