Skip to content

Commit f0864e3

Browse files
authored
Merge pull request rails#51193 from Shopify/fix-migrator-current-version
Fix `Migrator.current_version` to instantiate `SchemaMigration` correctly
2 parents 2abee30 + 6e74098 commit f0864e3

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)