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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 189352faaaca1fbd14c44dc39277909a0be585c4
4
- data.tar.gz: b9a1e4b29d44072e893942b7eadebde7d1d870ca
3
+ metadata.gz: 42877750a4d57f5cac5b36b8097d4a706a0397c4
4
+ data.tar.gz: b1826587627390ef41e4735cedb65aedb383c47b
5
5
  SHA512:
6
- metadata.gz: 1c9b52b4a9c8f5b72612724533465196755022c1d90bfcdf547f8400e296afce14c20b3462a7ef111cf63477f70ad43188eec099072718b04bdf2ac44fb632ec
7
- data.tar.gz: 6622d980e61a09900e7ea4810e69fde2e164ca781f347d4727a660095a668fed4ec5e922fa1d5847c12d9999388bf5b347fe9e3eb8fd396ddd6026cf9de83dbf
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
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_host_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff