aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-01-03 10:47:04 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-01-03 10:47:04 +0900
commit4ca73f448187c02b5474cf90dc7c3122ee0760ff (patch)
treee2016118fc020fb5e06bb7a0d1376f8ee75f5148 /activerecord
parentb6c6d28d2c9f29c6c97564700c4847748300d323 (diff)
parente07bcac01e5ae50009d61420b43d4e18fda746de (diff)
downloadrails-4ca73f448187c02b5474cf90dc7c3122ee0760ff.tar.gz
rails-4ca73f448187c02b5474cf90dc7c3122ee0760ff.tar.bz2
rails-4ca73f448187c02b5474cf90dc7c3122ee0760ff.zip
Merge pull request #25456 from ojab/master
Remove dormant check
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb4
-rw-r--r--activerecord/test/cases/connection_pool_test.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
index 9849f9d5d7..c730584902 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -1005,9 +1005,7 @@ module ActiveRecord
def retrieve_connection(spec_name) #:nodoc:
pool = retrieve_connection_pool(spec_name)
raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool
- conn = pool.connection
- raise ConnectionNotEstablished, "No connection for '#{spec_name}' in connection pool" unless conn
- conn
+ pool.connection
end
# Returns true if a connection that's accessible to this class has
diff --git a/activerecord/test/cases/connection_pool_test.rb b/activerecord/test/cases/connection_pool_test.rb
index 70c0ffb3bf..cb29c578b7 100644
--- a/activerecord/test/cases/connection_pool_test.rb
+++ b/activerecord/test/cases/connection_pool_test.rb
@@ -91,7 +91,7 @@ module ActiveRecord
end
def test_full_pool_exception
- @pool.size.times { @pool.checkout }
+ @pool.size.times { assert @pool.checkout }
assert_raises(ConnectionTimeoutError) do
@pool.checkout
end