replica_pools 2.3.0 → 2.3.1

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
  SHA256:
3
- metadata.gz: 9d9219fb04b0b4118f99202ad78486d565bb88fe57079f743336b381b50d5864
4
- data.tar.gz: e3fefd1456ce775cf127e0561d5827b39d4a45fab0ef4359178bf58d841887bc
3
+ metadata.gz: 1af9dd473884c12967be5648f4ff8e1cc2a029544bb27a76f7166698215b45f5
4
+ data.tar.gz: be05c7e623ec0cae9b3d6841edb6a6e5de1ada29c79a5f11854fc98000e63f7e
5
5
  SHA512:
6
- metadata.gz: a1777856dd70f4fd661ef3a7ca6d149f57772e72e9636cd0ef674476c858fa8ce1e086a846a79e624924c1838765e39a88273fb0d3d6b01812c01be7668fe69c
7
- data.tar.gz: 0f6f739901cfcf978c9d6b0b1a4e9efbd46c66c33954ab577186343c74eb5a9e499c15ed2d8fa6d8c97afc1f85854e81ef72cbeced472cc5cd0d7f0db59e3e15
6
+ metadata.gz: 99628a0df9823b14dae7a3dd2bd7d8ecb8e0333827616e06a56a352024fe27b89e6521af6a06e7dda243c92884aeb75437c8faad573c9598b7468e0fac1a87e3
7
+ data.tar.gz: e2ea27e89f05990765bb7025508ed590030f86763a44066f4f4372ec4239a71718fa0267e87b1027b0d0fb4ef4282dee24d2d1ec594a51d593d24be93ea7552e
@@ -33,7 +33,7 @@ module ReplicaPools
33
33
  # this ivar is for ConnectionAdapter compatibility
34
34
  # some gems (e.g. newrelic_rpm) will actually use
35
35
  # instance_variable_get(:@config) to find it.
36
- @config = current.connection_config
36
+ @config = current.connection_db_config
37
37
  end
38
38
 
39
39
  def with_pool(pool_name = 'default')
@@ -36,7 +36,9 @@ module ReplicaPools
36
36
  def config_hash
37
37
  if ActiveRecord::VERSION::MAJOR >= 6
38
38
  # in Rails >= 6, `configurations` is an instance of ActiveRecord::DatabaseConfigurations
39
- ActiveRecord::Base.configurations.to_h
39
+ ActiveRecord::Base.configurations.configs_for.map do |c|
40
+ [c.env_name, c.configuration_hash.transform_keys(&:to_s)]
41
+ end.to_h
40
42
  else
41
43
  # in Rails < 6, it's just a hash
42
44
  ActiveRecord::Base.configurations
@@ -50,7 +52,7 @@ module ReplicaPools
50
52
  ReplicaPools.const_set(class_name, Class.new(ActiveRecord::Base) do |c|
51
53
  c.abstract_class = true
52
54
  c.define_singleton_method(:connection_config) do
53
- configurations[connection_name.to_s]
55
+ configurations.configs_for(connection_name.to_s)
54
56
  end
55
57
  end)
56
58
 
@@ -1,3 +1,3 @@
1
1
  module ReplicaPools
2
- VERSION = "2.3.0"
2
+ VERSION = "2.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: replica_pools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Drabik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-04-28 00:00:00.000000000 Z
12
+ date: 2022-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord