1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #44956 from sato11/document-uses_transaction

Document `uses_transaction` [ci-skip]
This commit is contained in:
Jonathan Hefner 2022-05-02 21:54:33 -05:00 committed by GitHub
commit 74cd04d6ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,9 @@ module ActiveRecord
end
end
# Prevents automatically wrapping each specified test in a transaction,
# to allow application logic transactions to be tested in a top-level
# (non-nested) context.
def uses_transaction(*methods)
@uses_transaction = [] unless defined?(@uses_transaction)
@uses_transaction.concat methods.map(&:to_s)