replica_pools 2.4.1 → 2.5.0

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: ab90e26beb7efb6b13dd59a067a1507207d657659cac075ee91d1364a652e476
4
- data.tar.gz: 166edf9e559cc696d837f32c8558e31fc69e1b24708e4d6a543210317f7af5e2
3
+ metadata.gz: 5266f3b52cb6ff8d9e54175b60ee4938a2765ac08fc5c1a09af659b8a93d61f4
4
+ data.tar.gz: ad735b62e57f38f238941e579b106f744c41db7b2985d9a7044fd4fa3f738227
5
5
  SHA512:
6
- metadata.gz: bf7ec04c450f7338bb5aac3bb41784dd88b2d3e069423fc5fdfbe8f9d13657eb3e35180c5a52e18099a608effd6c57073c5b20af2150e2b20a6710a8eac4388b
7
- data.tar.gz: 4dfb218fbf9136d536b218072c2bba6a06ccd2412403461b9bc19184e9ac1767b8d1af64b5c025532f08651dd3b2fb4d04beea3e6202ea0f901a856f2a8396db
6
+ metadata.gz: a8a5292802eab9a70512d8e91b6838556614f35c43efd3d277c54b838e913168980bfbab0dedfd961ab55e4a0dc1b65f5422ee0cb3f4afddacc923d3a75b26e7
7
+ data.tar.gz: 9c7e5fa395316788a77e836a82a83a1e6141df829ea573539421e95e8d4b3ade55e6588afd85990dbbc2101fc519006312c022f1ad1524e1f74dc4e25a19fa2d
@@ -20,7 +20,7 @@ module ReplicaPools
20
20
  # Make sure transactions run on leader
21
21
  # Even if they're initiated from ActiveRecord::Base
22
22
  # (which doesn't have our hijack).
23
- def transaction(options = {}, &block)
23
+ def transaction(**options, &block)
24
24
  if self.connection.kind_of?(ConnectionProxy)
25
25
  super
26
26
  else
@@ -33,7 +33,11 @@ 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_db_config
36
+ if ActiveRecord::VERSION::MAJOR >= 7
37
+ @config = current.connection_db_config
38
+ else
39
+ @config = current.connection_config
40
+ end
37
41
  end
38
42
 
39
43
  def with_pool(pool_name = 'default')
@@ -97,9 +101,9 @@ module ReplicaPools
97
101
  leader_depth > 0
98
102
  end
99
103
 
100
- def route_to(conn, method, *args, &block)
104
+ def route_to(conn, method, *args, **keyword_args, &block)
101
105
  raise ReplicaPools::LeaderDisabled.new if ReplicaPools.config.disable_leader && conn == leader
102
- conn.retrieve_connection.send(method, *args, &block)
106
+ conn.retrieve_connection.send(method, *args, **keyword_args, &block)
103
107
  rescue => e
104
108
  ReplicaPools.log :error, "Error during ##{method}: #{e}"
105
109
  log_proxy_state
@@ -1,3 +1,3 @@
1
1
  module ReplicaPools
2
- VERSION = "2.4.1"
2
+ VERSION = "2.5.0"
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.4.1
4
+ version: 2.5.0
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: 2023-02-07 00:00:00.000000000 Z
12
+ date: 2023-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -158,14 +158,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '1.2'
160
160
  requirements: []
161
- rubygems_version: 3.1.6
161
+ rubygems_version: 3.2.33
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Connection proxy for ActiveRecord for leader / replica setups.
165
165
  test_files:
166
- - spec/spec_helper.rb
167
- - spec/pool_spec.rb
168
- - spec/slave_pools_spec.rb
169
166
  - spec/config/test_model.rb
170
- - spec/query_cache_spec.rb
171
167
  - spec/connection_proxy_spec.rb
168
+ - spec/pool_spec.rb
169
+ - spec/query_cache_spec.rb
170
+ - spec/slave_pools_spec.rb
171
+ - spec/spec_helper.rb