active_record_host_pool 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_host_pool/pool_proxy.rb +4 -1
- data/test/test_arhp.rb +0 -25
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42877750a4d57f5cac5b36b8097d4a706a0397c4
|
4
|
+
data.tar.gz: b1826587627390ef41e4735cedb65aedb383c47b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49e8b4607fbaa06e00a281b6cf5d2cae4265ba02b34ebbcc2f6af0d2c6d353b698b9ae68ecb4abc474fcd9ee855aa0c67cd82342bdf85d1ba9fbe1a5c5bfcb5e
|
7
|
+
data.tar.gz: 8e8a120c71e1d04810e01d01d44e1983f7bef96626630dbaabb1a67f4e94c3b955376af973e372e7e87391396914b920e7fc9d83feccc801fc33b1b7110c5796
|
@@ -40,7 +40,7 @@ module ActiveRecordHostPool
|
|
40
40
|
if rescuable_errors.any? { |r| e.is_a?(r) }
|
41
41
|
_connection_pools.delete(_pool_key)
|
42
42
|
end
|
43
|
-
raise(e)
|
43
|
+
Kernel.raise(e)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -86,6 +86,9 @@ module ActiveRecordHostPool
|
|
86
86
|
if Object.const_defined?("Mysql2")
|
87
87
|
e << Mysql2::Error
|
88
88
|
end
|
89
|
+
if ActiveRecord.const_defined?("NoDatabaseError")
|
90
|
+
e << ActiveRecord::NoDatabaseError
|
91
|
+
end
|
89
92
|
e
|
90
93
|
end
|
91
94
|
end
|
data/test/test_arhp.rb
CHANGED
@@ -118,31 +118,6 @@ class ActiveRecordHostPoolTest < MiniTest::Unit::TestCase
|
|
118
118
|
assert_equal expected_database, current_database(switch_to_klass)
|
119
119
|
end
|
120
120
|
|
121
|
-
# rake db:create uses a pattern where it tries to connect to a non-existant database.
|
122
|
-
# but then we had this left in the connection pool cache.
|
123
|
-
# It's also almost impossible to test at this level, so I'm stubbing out the test
|
124
|
-
def _test_connecting_to_wrong_db_first
|
125
|
-
pools = ActiveRecord::Base.connection_handler.connection_pools
|
126
|
-
if !pools.empty?
|
127
|
-
ActiveRecord::Base.connection_handler.connection_pools.values.first.send(:_connection_pools).clear
|
128
|
-
ActiveRecord::Base.connection_handler.connection_pools.clear
|
129
|
-
end
|
130
|
-
|
131
|
-
begin
|
132
|
-
eval <<-EOC
|
133
|
-
class TestNotThere < ActiveRecord::Base
|
134
|
-
establish_connection("test_host_1_db_not_there")
|
135
|
-
end
|
136
|
-
EOC
|
137
|
-
rescue Exception => e
|
138
|
-
assert e.message =~ /Unknown database/
|
139
|
-
end
|
140
|
-
|
141
|
-
Test1.establish_connection("test_host_1_db_1")
|
142
|
-
# assert it doesn't raise.
|
143
|
-
assert Test1.connection
|
144
|
-
end
|
145
|
-
|
146
121
|
def teardown
|
147
122
|
arhp_drop_databases
|
148
123
|
end
|