connection_pool_list(role = nil)
public
Returns the pools for a connection handler and given role. If
:all is passed, all pools belonging to the connection handler will
be returned.
# File activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb, line 107
def connection_pool_list(role = nil)
if role.nil?
deprecation_for_pool_handling(__method__)
role = ActiveRecord::Base.current_role
connection_name_to_pool_manager.values.flat_map { |m| m.pool_configs(role).map(&:pool) }
elsif role == :all
connection_name_to_pool_manager.values.flat_map { |m| m.pool_configs.map(&:pool) }
else
connection_name_to_pool_manager.values.flat_map { |m| m.pool_configs(role).map(&:pool) }
end
end