Skip to content

Commit

Permalink
Don't handle this change for legacy_connection_handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eileencodes committed Aug 5, 2022
1 parent 0667ba4 commit fb09b1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion activerecord/lib/active_record/test_fixtures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def setup_fixtures(config = ActiveRecord::Base)
@connection_subscriber = ActiveSupport::Notifications.subscribe("!connection.active_record") do |_, _, _, _, payload|
spec_name = payload[:spec_name] if payload.key?(:spec_name)
shard = payload[:shard] if payload.key?(:shard)
setup_shared_connection_pool if ActiveRecord.legacy_connection_handling

if spec_name
begin
Expand All @@ -146,7 +147,7 @@ def setup_fixtures(config = ActiveRecord::Base)
end

if connection
setup_shared_connection_pool
setup_shared_connection_pool unless ActiveRecord.legacy_connection_handling

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

0 comments on commit fb09b1b

Please sign in to comment.