From d8e7fc4f5d9795ac83ca8ecd3c0cf0c5ec572487 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 5 Jul 2024 09:29:32 +0800 Subject: [PATCH] DEV: `check_pending` -> `check_all_pending!` (#27724) Fixes the following deprecation warning: > DEPRECATION WARNING: The `check_pending!` method is deprecated in favor of `check_all_pending!`. The new implementation will loop through all available database configurations and find pending migrations. The prior implementation did not permit this. --- lib/turbo_tests/runner.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/turbo_tests/runner.rb b/lib/turbo_tests/runner.rb index 29485156c15..41f9c2bbcae 100644 --- a/lib/turbo_tests/runner.rb +++ b/lib/turbo_tests/runner.rb @@ -124,15 +124,11 @@ module TurboTests ActiveRecord::Tasks::DatabaseTasks.migrations_paths = %w[db/migrate db/post_migrate] - conn = ActiveRecord::Base.establish_connection(config).connection - begin - ActiveRecord::Migration.check_pending!(conn) + ActiveRecord::Migration.check_all_pending! rescue ActiveRecord::PendingMigrationError puts "There are pending migrations, run rake parallel:migrate" exit 1 - ensure - conn.close end end