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.

Rails Guide Update - ActiveRecord Transaction Callbacks

#6310

I've update the Rails Guide on ActiveRecord validation and callbacks to document the after_commit and after_rollback callbacks added in Rails 3.0.

Reported by Brian Durand · January 18th, 2011 @ 06:13 PM

State: new
Milestone: none
Assigned to: Xavier Noria Xavier Noria
Importance: Low

Activity

  1. Brian Durand
    Brian Durand
    • Tag changed from rails guides to rails guides, patch

    January 18th, 2011 @ 06:18 PM

  2. Xavier Noria
    Xavier Noria
    • Assigned user set to Xavier Noria
    • Importance changed from to Low

    January 20th, 2011 @ 07:49 AM

  3. Peter Abrahamsen
    Peter Abrahamsen

    This is great, thanks for doing it. I would like to see it explain the behavior around nested transactions. The desired behavior, and I think this is what AR implements is:

    • after_commit is triggered after the outermost transaction commits
    • after_rollback is triggered after the transaction the record was updated/whatever in is rolled back

    This behavior should also be explained in the API docs.

    April 6th, 2011 @ 07:32 PM