Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Restore timestamps in model rollback

#93

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.

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

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik

    I wonder if it'd possible to use existing stored old values from Dirty module ?

    Thanks.

    May 12th, 2008 @ 02:16 AM

  2. Xavier Noria
    Xavier Noria

    Oh yes much better, I'll rewrite it.

    May 12th, 2008 @ 10:39 AM

  3. Pratik
    Pratik
    • State changed from new to incomplete

    May 13th, 2008 @ 05:45 PM

  4. Rohit Arondekar
    Rohit Arondekar
    • State changed from incomplete to stale
    • Tag set to activerecord, bug, patch
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 6th, 2010 @ 06:47 AM