1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

elaborate on transaction changes

This commit is contained in:
HoyaBoya 2015-11-05 13:37:51 -05:00
parent ce66570a27
commit 41700c5260

View file

@ -620,6 +620,17 @@ Since version *3.0.13* AASM supports ActiveRecord transactions. So whenever a tr
callback or the state update fails, all changes to any database record are rolled back.
Mongodb does not support transactions.
There are currently 3 transactional callbacks that can be handled on the event, and 2 transactional callbacks for all events.
```ruby
event before_all_transactions
event before_transaction
event aasm_fire_event (within transaction)
event after_commit (if event successful)
event after_transaction
event after_all_transactions
```
If you want to make sure a depending action happens only after the transaction is committed,
use the `after_commit` callback, like this: