Skip to content

Commit

Permalink
Avoid a deprecation warning or error for the `commit_transaction_on_n…
Browse files Browse the repository at this point in the history
…on_local_return` configuration setting
  • Loading branch information
fractaledmind committed Dec 16, 2024
1 parent 4684c96 commit 7a932ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
end

# see: https://github.com/rails/rails/pull/48600
if ActiveRecord.respond_to?(:commit_transaction_on_non_local_return)
if ActiveRecord.respond_to?(:commit_transaction_on_non_local_return) &&
Rails::VERSION::MAJOR >= 7 &&
Rails::VERSION::MINOR <= 1
ActiveRecord.commit_transaction_on_non_local_return = true
end

Expand Down

0 comments on commit 7a932ac

Please sign in to comment.