Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2805,10 +2805,11 @@ def test_with_recursive_coerced

module ActiveRecord
class AdapterConnectionTest < ActiveRecord::TestCase
# Original method defined for core adapters.
# Original method only handled the core adapters.
undef_method :raw_transaction_open?
def raw_transaction_open?(connection)
connection.instance_variable_get(:@raw_connection).query("SELECT @@trancount").to_a[0][0] > 0
transaction_count = connection.instance_variable_get(:@raw_connection).execute("SELECT @@TRANCOUNT AS TRANSACTION_COUNT").first["TRANSACTION_COUNT"]
transaction_count > 0
rescue
false
end
Expand Down
Loading