Skip to content

Commit 6e74098

Browse files
committed
Fix Migrator.current_version to instantiate SchemaMigration correctly
This was missed in rails#51162
1 parent 2abee30 commit 6e74098

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

activerecord/lib/active_record/migration.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,9 +1405,8 @@ class << self
14051405

14061406
# For cases where a table doesn't exist like loading from schema cache
14071407
def current_version
1408-
connection = ActiveRecord::Tasks::DatabaseTasks.migration_connection
14091408
connection_pool = ActiveRecord::Tasks::DatabaseTasks.migration_connection_pool
1410-
schema_migration = SchemaMigration.new(connection)
1409+
schema_migration = SchemaMigration.new(connection_pool)
14111410
internal_metadata = InternalMetadata.new(connection_pool)
14121411

14131412
MigrationContext.new(migrations_paths, schema_migration, internal_metadata).current_version

0 commit comments

Comments
 (0)