This project is archived and is in readonly mode.

#6310 new
Brian Durand

Rails Guide Update - ActiveRecord Transaction Callbacks

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

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.

Comments and changes to this ticket

  • Brian Durand

    Brian Durand January 18th, 2011 @ 06:18 PM

    • Tag changed from rails guides to rails guides, patch
  • Xavier Noria

    Xavier Noria January 20th, 2011 @ 07:49 AM

    • Assigned user set to “Xavier Noria”
    • Importance changed from “” to “Low”
  • Peter Abrahamsen

    Peter Abrahamsen April 6th, 2011 @ 07:32 PM

    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.

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=""></a>