Return an array of pools from `connection_pools`

上级 634ecdbf
* Return an array of pools from `connection_pools`.
*Rafael Mendonça França*
* Return a null column from `column_for_attribute` when no column exists.
*Rafael Mendonça França*
......
......@@ -2,7 +2,6 @@
require 'thread_safe'
require 'monitor'
require 'set'
require 'active_support/core_ext/string/filters'
module ActiveRecord
# Raised when a connection could not be obtained within the connection
......@@ -517,15 +516,7 @@ def initialize
def connection_pool_list
owner_to_pool.values.compact
end
def connection_pools
ActiveSupport::Deprecation.warn(<<-MSG.squish)
In the next release, this will return the same as `#connection_pool_list`.
(An array of pools, rather than a hash mapping specs to pools.)
MSG
Hash[connection_pool_list.map { |pool| [pool.spec, pool] }]
end
alias :connection_pools :connection_pool_list
def establish_connection(owner, spec)
@class_to_pool.clear
......
......@@ -44,9 +44,7 @@ def test_retrieve_connection_pool_uses_superclass_pool_after_subclass_establish_
end
def test_connection_pools
assert_deprecated do
assert_equal({ Base.connection_pool.spec => @pool }, @handler.connection_pools)
end
assert_equal([@pool], @handler.connection_pools)
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册