Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _construct_relation_for_exists(conditions)
end
# End of monkey-patch
else
relation = except(:select, :distinct, :order)._select!(::ActiveRecord::FinderMethods::ONE_AS_ONE).limit!(1)
relation = except(:select, :distinct, :order)._select!(Arel.sql(::ActiveRecord::FinderMethods::ONE_AS_ONE, retryable: true)).limit!(1)
end

case conditions
Expand Down
13 changes: 12 additions & 1 deletion test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,7 @@ def with_marshable_time_defaults
# Revert changes
@connection.change_column_default(:sst_datatypes, :datetime, current_default) if current_default.present?
end

# We need to give the full paths for this to work.
undef_method :schema_dump_5_1_path
def schema_dump_5_1_path
Expand Down Expand Up @@ -2796,3 +2796,14 @@ def test_with_recursive_coerced
end
end

module ActiveRecord
class AdapterConnectionTest < ActiveRecord::TestCase
# Original method defined for 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
rescue
false
end
end
end
Loading