Skip to content

Commit

Permalink
Merge pull request #44956 from sato11/document-uses_transaction
Browse files Browse the repository at this point in the history
Document `uses_transaction` [ci-skip]

(cherry picked from commit 74cd04d)
  • Loading branch information
jonathanhefner committed May 3, 2022
1 parent 2722895 commit 3594d29
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 @@ -86,6 +86,9 @@ def setup_fixture_accessors(fixture_set_names = nil)
include methods
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 3594d29

Please sign in to comment.