Skip to content

Commit

Permalink
Remove db_config from yield arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmaples committed Jan 17, 2024
1 parent c8588dd commit c5a86b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/data_migrate/database_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def with_temporary_connection_for_each(env: ActiveRecord::Tasks::DatabaseTasks.e

def with_temporary_connection(db_config) # :nodoc:
with_temporary_pool(db_config) do |pool|
yield pool.connection, db_config
yield pool.connection
end
end

Expand All @@ -49,7 +49,8 @@ def migration_connection # :nodoc:
def db_configs_with_versions
db_configs_with_versions = Hash.new { |h, k| h[k] = [] }

with_temporary_connection_for_each do |conn, db_config|
with_temporary_connection_for_each do |conn|
db_config = conn.pool.db_config
if db_config.primary?
versions_to_run = DataMigrate::DatabaseTasks.pending_data_migrations.map { |m| m[:version] }
target_version = ActiveRecord::Tasks::DatabaseTasks.target_version
Expand Down

0 comments on commit c5a86b4

Please sign in to comment.