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 +4 -4
- data/lib/replica_pools/connection_proxy.rb +1 -1
- data/lib/replica_pools/pools.rb +4 -2
- data/lib/replica_pools/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1af9dd473884c12967be5648f4ff8e1cc2a029544bb27a76f7166698215b45f5
|
4
|
+
data.tar.gz: be05c7e623ec0cae9b3d6841edb6a6e5de1ada29c79a5f11854fc98000e63f7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
36
|
+
@config = current.connection_db_config
|
37
37
|
end
|
38
38
|
|
39
39
|
def with_pool(pool_name = 'default')
|
data/lib/replica_pools/pools.rb
CHANGED
@@ -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.
|
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
|
55
|
+
configurations.configs_for(connection_name.to_s)
|
54
56
|
end
|
55
57
|
end)
|
56
58
|
|
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.
|
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-
|
12
|
+
date: 2022-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|