Method: ActiveRecord::PendingMigrationConnection.with_temporary_pool

Defined in:
activerecord/lib/active_record/migration/pending_migration_connection.rb

.with_temporary_pool(db_config, &block) ⇒ Object



5
6
7
8
9
10
11
# File 'activerecord/lib/active_record/migration/pending_migration_connection.rb', line 5

def self.with_temporary_pool(db_config, &block)
  pool = ActiveRecord::Base.connection_handler.establish_connection(db_config, owner_name: self)

  yield pool
ensure
  ActiveRecord::Base.connection_handler.remove_connection_pool(self.name)
end