Rails Guide Update - ActiveRecord Transaction Callbacks #817

Closed
lighthouse-import opened this Issue May 16, 2011 · 5 comments

Projects

None yet

3 participants

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6310
Created by Brian Durand - 2011-01-18 18:13:28 UTC

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.

Imported from Lighthouse.
Comment by Peter Abrahamsen - 2011-04-06 18:32:17 UTC

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.

Attachments saved to Gist: http://gist.github.com/971765

Contributor
bdurand commented May 16, 2011

This issue can be closed. The change was already applied to the guides.

Member

@bdurand Would be nice if you can mention the commit hash here. Easy for later reference. cc @josevalim

Contributor
bdurand commented May 19, 2011

Committed in 017012b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment