Permalink
Browse files

Add after_commit/after_rollback to callback list

Adding after_commit/after_rollback to list of callbacks in order helps
explain the callback order as well as making it consistent with the API
docs at http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
  • Loading branch information...
Kyle Heironimus
Kyle Heironimus committed Apr 10, 2014
1 parent 1938c96 commit 16f481b28bb1299e5aa5c610ca4c90be8482edc7
Showing with 3 additions and 0 deletions.
  1. +3 −0 guides/source/active_record_callbacks.md
@@ -92,6 +92,7 @@ Here is a list with all the available Active Record callbacks, listed in the sam
* `around_create`
* `after_create`
* `after_save`
+* `after_commit/after_rollback`
### Updating an Object
@@ -103,12 +104,14 @@ Here is a list with all the available Active Record callbacks, listed in the sam
* `around_update`
* `after_update`
* `after_save`
+* `after_commit/after_rollback`
### Destroying an Object
* `before_destroy`
* `around_destroy`
* `after_destroy`
+* `after_commit/after_rollback`
WARNING. `after_save` runs both on create and update, but always _after_ the more specific callbacks `after_create` and `after_update`, no matter the order in which the macro calls were executed.

0 comments on commit 16f481b

Please sign in to comment.