diff options
author | Eugene Kenny <elkenny@gmail.com> | 2018-11-07 01:11:53 +0000 |
---|---|---|
committer | Eugene Kenny <elkenny@gmail.com> | 2018-11-07 13:32:49 +0000 |
commit | 9030b7c7751ba8375697baaee461b1a6435ad5fe (patch) | |
tree | 88b7248c79b17a208839e5eaaa1c69c9116e2a25 /activestorage | |
parent | 133e0ba33db5887b047c9ac8233e5b414657bca5 (diff) | |
download | rails-9030b7c7751ba8375697baaee461b1a6435ad5fe.tar.gz rails-9030b7c7751ba8375697baaee461b1a6435ad5fe.tar.bz2 rails-9030b7c7751ba8375697baaee461b1a6435ad5fe.zip |
Always add records to parent of nested transaction
When a record with transactional callbacks is saved, it's attached to
the current transaction so that the callbacks can be run when the
transaction is committed. Records can also be added manually with
`add_transaction_record`, even if they have no transactional callbacks.
When a nested transaction is committed, its records are transferred to
the parent transaction, as transactional callbacks should only be run
when the outermost transaction is committed (the "real" transaction).
However, this currently only happens when the record has transactional
callbacks, and not when added manually with `add_transaction_record`.
If a record is added to a nested transaction, we should always attach it
to the parent transaction when the nested transaction is committed,
regardless of whether it has any transactional callbacks.
[Eugene Kenny & Ryuta Kamizono]
Diffstat (limited to 'activestorage')
0 files changed, 0 insertions, 0 deletions