replica_pools 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca5913b321778c59730e29d5845c52cec3acc626ce4940e921fb40309ef3f39b
4
- data.tar.gz: 89cbec0176c695013e1fa3691d02d004aa05bda88ccfcaf60c1452da06d7b9ac
3
+ metadata.gz: da0145ee587f2856d0ba448914437caf148e8825abc9e2b31a853e8c6585ffdb
4
+ data.tar.gz: 26ffb29f8c44dcaefa6f0ba16452ab4af4757c46e1f660d76f6e3906cc2edb06
5
5
  SHA512:
6
- metadata.gz: 6a99fc420ef83d2eee33302c0c50095a64c8c7f47c11471bc3310afb3557e22e64f6a6b4a288cd750b830c552cb9f6a3cc742e07c95ae9b1816a25f20d31b0c2
7
- data.tar.gz: eb1e3a46c3e4bb83b5510f782f493e7490a8165bd5ea23952726d6d3e36bef7216811960254e87292a0628534ec06471aa442c56535b3a68cfaab2c9b471499a
6
+ metadata.gz: 70883d9c60ccfc07230b262af71c476d2944321e371a6bbdc4ba873eefe17e49e9185ac1bae7a95b30f51f6874b2a8d313fe2b35dc3b9c3253918b590d8a5798
7
+ data.tar.gz: c47b4975d6bbc30e44602ed51a60ea9d827624b3dabf726ad54d21524691e8acbf78545d7b1afecf5322d5122fce2a908b0461a68f6411a0f16e058354356c64
@@ -34,18 +34,20 @@ module ReplicaPools
34
34
  end
35
35
 
36
36
  def config_hash
37
- if ActiveRecord::VERSION::MAJOR > 6
38
- # in Rails = 7, ActiveRecord::Base.configurations.to_h has been deprecated
39
- ActiveRecord::Base.configurations.configs_for.map do |c|
40
- [c.env_name, c.configuration_hash.transform_keys(&:to_s)]
41
- end.to_h
42
- elsif ActiveRecord::VERSION::MAJOR == 6
43
- # in Rails = 6, `configurations` is an instance of ActiveRecord::DatabaseConfigurations
44
- ActiveRecord::Base.configurations.to_h
45
- else
37
+ if ActiveRecord::VERSION::MAJOR < 6
46
38
  # in Rails < 6, it's just a hash
47
- ActiveRecord::Base.configurations
39
+ return ActiveRecord::Base.configurations
48
40
  end
41
+
42
+ if ActiveRecord::VERSION::MAJOR == 6 && ActiveRecord::VERSION::MINOR < 1
43
+ # in Rails = 6.0, `configurations` is an instance of ActiveRecord::DatabaseConfigurations
44
+ return ActiveRecord::Base.configurations.to_h
45
+ end
46
+
47
+ # in Rails >= 6.1, ActiveRecord::Base.configurations.to_h has been deprecated
48
+ ActiveRecord::Base.configurations.configs_for.map do |c|
49
+ [c.env_name, c.configuration_hash.transform_keys(&:to_s)]
50
+ end.to_h
49
51
  end
50
52
 
51
53
  # generates a unique ActiveRecord::Base subclass for a single replica
@@ -1,3 +1,3 @@
1
1
  module ReplicaPools
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: replica_pools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Drabik
8
8
  - Lance Ivy
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-23 00:00:00.000000000 Z
12
+ date: 2023-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -143,7 +143,7 @@ homepage: https://github.com/kickstarter/replica_pools
143
143
  licenses:
144
144
  - MIT
145
145
  metadata: {}
146
- post_install_message:
146
+ post_install_message:
147
147
  rdoc_options: []
148
148
  require_paths:
149
149
  - lib
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: '1.2'
160
160
  requirements: []
161
161
  rubygems_version: 3.1.6
162
- signing_key:
162
+ signing_key:
163
163
  specification_version: 4
164
164
  summary: Connection proxy for ActiveRecord for leader / replica setups.
165
165
  test_files: