Remove deprecated #all_connection_pools

This commit is contained in:
Rafael Mendonça França 2023-11-06 22:34:29 +00:00
parent 7ddf423329
commit 9489c14b7b
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
4 changed files with 6 additions and 14 deletions

@ -1,3 +1,7 @@
* Remove deprecated `#all_connection_pools`.
*Rafael Mendonça França*
* Remove deprecated `ActiveRecord::ConnectionAdapters::SchemaCache#data_sources`.
*Rafael Mendonça França*

@ -88,14 +88,6 @@ def connection_pool_names # :nodoc:
connection_name_to_pool_manager.keys
end
def all_connection_pools
ActiveRecord.deprecator.warn(<<-MSG.squish)
The `all_connection_pools` method is deprecated in favor of `connection_pool_list`.
Call `connection_pool_list(:all)` to get the same behavior as `all_connection_pools`.
MSG
connection_name_to_pool_manager.values.flat_map { |m| m.pool_configs.map(&:pool) }
end
# Returns the pools for a connection handler and given role. If +:all+ is passed,
# all pools belonging to the connection handler will be returned.
def connection_pool_list(role = nil)

@ -328,12 +328,6 @@ def test_connection_pool_list
end
end
def test_all_connection_pools
assert_deprecated(ActiveRecord.deprecator) do
assert_equal([@rw_pool, @ro_pool], @handler.all_connection_pools)
end
end
def test_retrieve_connection
assert @handler.retrieve_connection(@connection_name)
assert @handler.retrieve_connection(@connection_name, role: :reading)

@ -148,6 +148,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
* Remove deprecated `ActiveRecord::ConnectionAdapters::SchemaCache#data_sources`.
* Remove deprecated `#all_connection_pools`.
### Deprecations
* Deprecate `Rails.application.config.active_record.allow_deprecated_singular_associations_name`