Skip to content

Commit

Permalink
Merge pull request rails#44956 from sato11/document-uses_transaction
Browse files Browse the repository at this point in the history
Document `uses_transaction` [ci-skip]
  • Loading branch information
jonathanhefner committed May 3, 2022
2 parents de12c18 + f172628 commit 74cd04d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions activerecord/lib/active_record/test_fixtures.rb
Expand Up @@ -67,6 +67,9 @@ def setup_fixture_accessors(fixture_set_names = nil)
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)
Expand Down

0 comments on commit 74cd04d

Please sign in to comment.