1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test
Ryuta Kamizono 718a32ca74 Should attempt committed!/rolledback! to all enrolled records in the transaction
Currently, `committed!`/`rolledback!` will only be attempted for the
first enrolled record in the transaction, that will cause some
problematic behaviors.

The first one problem, `clear_transaction_record_state` won't be called
even if the transaction is finalized except the first enrolled record.
This means that de-duplicated records in the transaction won't refer
latest state (e.g. won't happen rolling back record state).

The second one problem, the enrolled order is not always the same as the
order in which the actions actually happened, the first enrolled record
may succeed no actions (e.g. `destroy` has already succeeded on another
record during `before_destroy`), it will lose to fire any transactional
callbacks.

To avoid both problems, we should attempt `committed!`/`rolledback!` to
all enrolled records in the transaction.
2019-05-07 02:19:57 +09:00
..
active_record/connection_adapters
assets
cases Should attempt committed!/rolledback! to all enrolled records in the transaction 2019-05-07 02:19:57 +09:00
fixtures
migrations
models Namespace association extension modules under the owner model 2019-05-02 13:25:18 +02:00
schema Adds touch option to has_one association 2019-04-25 03:31:34 +09:00
support Remove duplicated protected params definitions 2019-02-24 19:50:53 +09:00
config.example.yml Respect ENV variables when finding DBs etc for the test suite 2019-02-06 01:20:06 +10:30
config.rb