Skip to content

Commit e1e1620

Browse files
authored
Merge pull request rails#46268 from eileencodes/cleanup-check-pending
Cleanup check pending
2 parents cf848c4 + ab483d5 commit e1e1620

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

activerecord/lib/active_record/migration.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,7 @@ def check_pending!(connection = Base.connection)
638638
end
639639

640640
def load_schema_if_pending!
641-
all_configs = db_configs_in_current_env
642-
643-
needs_update = !all_configs.all? do |db_config|
641+
needs_update = !db_configs_in_current_env.all? do |db_config|
644642
Tasks::DatabaseTasks.schema_up_to_date?(db_config, ActiveRecord.schema_format)
645643
end
646644

@@ -653,7 +651,7 @@ def load_schema_if_pending!
653651
end
654652
end
655653

656-
check_pending_migrations(db_configs: all_configs)
654+
check_pending_migrations
657655
end
658656

659657
def maintain_test_schema! # :nodoc:
@@ -679,9 +677,10 @@ def disable_ddl_transaction!
679677
@disable_ddl_transaction = true
680678
end
681679

682-
def check_pending_migrations(db_configs: db_configs_in_current_env) # :nodoc:
680+
def check_pending_migrations # :nodoc:
683681
prev_db_config = Base.connection_db_config
684-
db_configs.each do |db_config|
682+
683+
db_configs_in_current_env.each do |db_config|
685684
Base.establish_connection(db_config)
686685
check_pending!
687686
end

0 commit comments

Comments
 (0)