Skip to content
Browse files

Merge pull request #12545 from nateberkopec/rephrase_callback_warning

Rephrase ActiveRecord transaction rollback warning [ci skip]
  • Loading branch information...
2 parents 49bc23f + cb609b3 commit f2ca5aa5c2e9fed43ab11937906d98bd436ab820 @senny senny committed Oct 16, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 guides/source/
2 guides/source/
@@ -204,7 +204,7 @@ As you start registering new callbacks for your models, they will be queued for
The whole callback chain is wrapped in a transaction. If any _before_ callback method returns exactly `false` or raises an exception, the execution chain gets halted and a ROLLBACK is issued; _after_ callbacks can only accomplish that by raising an exception.
-WARNING. Raising an arbitrary exception may break code that expects `save` and its friends not to fail like that. The `ActiveRecord::Rollback` exception is thought precisely to tell Active Record a rollback is going on. That one is internally captured but not reraised.
+WARNING. Any exception that is not `ActiveRecord::Rollback` will be re-raised by Rails after the callback chain is halted. Raising an exception other than `ActiveRecord::Rollback` may break code that does not expect methods like `save` and `update_attributes` (which normally try to return `true` or `false`) to raise an exception.
Relational Callbacks

0 comments on commit f2ca5aa

Please sign in to comment.
Something went wrong with that request. Please try again.