From b4d153544b6f795e3edd43ba9aa5a0afb96836f1 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 10 Jul 2024 17:34:48 +0900 Subject: [PATCH] AR8::SchemaMigration.new takes a connection_pool since https://github.com/rails/rails/pull/51162 --- test/database_rewinder_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/database_rewinder_test.rb b/test/database_rewinder_test.rb index 38acac7..b525e18 100644 --- a/test/database_rewinder_test.rb +++ b/test/database_rewinder_test.rb @@ -211,7 +211,11 @@ def perform_insert(sql) sub_test_case 'migrations' do if ActiveRecord::VERSION::STRING >= '7.1' test '.clean_all should not touch AR::SchemaMigration' do - schema_migration = ActiveRecord::SchemaMigration.new(ActiveRecord::Base.connection) + schema_migration = if ActiveRecord::VERSION::MAJOR >= 8 + ActiveRecord::SchemaMigration.new(ActiveRecord::Base.connection_pool) + else + ActiveRecord::SchemaMigration.new(ActiveRecord::Base.connection) + end schema_migration.create_table begin