instance method
teardown_shared_connection_pool
Ruby on Rails 7.0.10
Since v6.0.6 PrivateSignature
teardown_shared_connection_pool()
No documentation comment.
Source
# File activerecord/lib/active_record/test_fixtures.rb, line 245
def teardown_shared_connection_pool
if ActiveRecord.legacy_connection_handling
@legacy_saved_pool_configs.each_pair do |handler, names|
names.each_pair do |name, shards|
shards.each_pair do |shard_name, pool_config|
pool_manager = handler.send(:owner_to_pool_manager)[name]
pool_manager.set_pool_config(nil, shard_name, pool_config)
end
end
end
else
handler = ActiveRecord::Base.connection_handler
@saved_pool_configs.each_pair do |name, shards|
pool_manager = handler.send(:owner_to_pool_manager)[name]
shards.each_pair do |shard_name, roles|
roles.each_pair do |role, pool_config|
next unless pool_manager.get_pool_config(role, shard_name)
pool_manager.set_pool_config(role, shard_name, pool_config)
end
end
end
end
@legacy_saved_pool_configs.clear
@saved_pool_configs.clear
end
Defined in activerecord/lib/active_record/test_fixtures.rb line 245
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::TestFixtures