Commit transactions when using return inside them

It doesn't really affect us because we never use `return`, `break` or
`throw` inside transactions, since it would be confusing exactly because
it wouldn't be 100% clear whether the transaction is committed or not.

So we're using the new default value, which will be the only available
option in Rails 7.2 [1].

[1] Commit eccc6061f4 in https://github.com/rails/rails
This commit is contained in:
Javi Martín
2024-04-15 16:41:21 +02:00
parent d6b642a23d
commit e35bf97928

View File

@@ -209,7 +209,7 @@ Rails.application.config.active_record.run_after_transaction_callbacks_in_order_
### ###
# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`. # Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
#++ #++
# Rails.application.config.active_record.commit_transaction_on_non_local_return = true Rails.application.config.active_record.commit_transaction_on_non_local_return = true
### ###
# Controls when to generate a value for <tt>has_secure_token</tt> declarations. # Controls when to generate a value for <tt>has_secure_token</tt> declarations.