method
remove_connection
v7.1.3.4 -
Show latest stable
- Class:
ActiveRecord::ConnectionHandling
remove_connection(name = nil)public
No documentation available.
# File activerecord/lib/active_record/connection_handling.rb, line 295
def remove_connection(name = nil)
if name
ActiveRecord.deprecator.warn( The name argument for `#remove_connection` is deprecated without replacement and will be removed in Rails 7.2. `#remove_connection` should always be called on the connection class directly, which makes the name argument obsolete..squish)
end
name ||= @connection_specification_name if defined?(@connection_specification_name)
# if removing a connection that has a pool, we reset the
# connection_specification_name so it will use the parent
# pool.
if connection_handler.retrieve_connection_pool(name, role: current_role, shard: current_shard)
self.connection_specification_name = nil
end
connection_handler.remove_connection_pool(name, role: current_role, shard: current_shard)
end