1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Return an array of pools from connection_pools

This commit is contained in:
Rafael Mendonça França 2015-01-03 23:49:41 -03:00
parent 634ecdbf1b
commit 94c87156fd
3 changed files with 6 additions and 13 deletions

View file

@ -1,3 +1,7 @@
* 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*

View file

@ -2,7 +2,6 @@ require 'thread'
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 @@ module ActiveRecord
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

View file

@ -44,9 +44,7 @@ module ActiveRecord
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