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

Document uses_transaction [ci-skip]

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
This commit is contained in:
Junichi Sato 2022-04-26 01:55:42 +09:00
parent dbb065dba9
commit f17262839a
No known key found for this signature in database
GPG key ID: 6CEF8C0F22CB941D

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)