Skip to content

Commit fb09b1b

Browse files
committed
Don't handle this change for legacy_connection_handling
PR #45773 broke legacy handling test fixtures and while I can fix this particular error it breaks how shared pools are setup. I don't think this is the same kind of buggy on legacy handling so let's leave that behavior and only change the new handling.
1 parent 0667ba4 commit fb09b1b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

activerecord/lib/active_record/test_fixtures.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def setup_fixtures(config = ActiveRecord::Base)
137137
@connection_subscriber = ActiveSupport::Notifications.subscribe("!connection.active_record") do |_, _, _, _, payload|
138138
spec_name = payload[:spec_name] if payload.key?(:spec_name)
139139
shard = payload[:shard] if payload.key?(:shard)
140+
setup_shared_connection_pool if ActiveRecord.legacy_connection_handling
140141

141142
if spec_name
142143
begin
@@ -146,7 +147,7 @@ def setup_fixtures(config = ActiveRecord::Base)
146147
end
147148

148149
if connection
149-
setup_shared_connection_pool
150+
setup_shared_connection_pool unless ActiveRecord.legacy_connection_handling
150151

151152
if !@fixture_connections.include?(connection)
152153
connection.begin_transaction joinable: false, _lazy: false

0 commit comments

Comments
 (0)