replica_pools 2.2.0 → 2.2.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: 462aae1dab48a6627d29f3181b50f1c3308dad3ba815a29bb42f99e8a5e8d52f
4
- data.tar.gz: 6104dc1df24757864e2be2db306c2dd52781453c80c6c7b268e2302659766a90
3
+ metadata.gz: b9a32096014e9f2cd137adb7c8fe226173f40d9dea893a319c0dab24cbdf8371
4
+ data.tar.gz: da62952df8213322963f8b8ce0c5da9ed8efe381c2348801794ec0ef0b6d294a
5
5
  SHA512:
6
- metadata.gz: d023920b32b935399f3ecf0ee44d74a1050a63c836ce3ea56ce22046b09994aa490df66d0c3ba5d1b578e8fbdf70470158028612f2f1c3fac883c72aeb7713cf
7
- data.tar.gz: 8bfe386f6d12b1a706852cc734f3eef33dcf6c686a1726bebf628bee42b0e57030abb9ac58afa67ba579d22e118bf2a49b4e37c182367d536bff8b2990518543
6
+ metadata.gz: 7f2d2abc5f7badb102c8116213b306d35336f6d54c651a74d6fcaa0e37c53c5282c46fbc643984ffde43f5e54d868051c38590372b8af4329741da1247b68128
7
+ data.tar.gz: 51c4514ec6e0fa79ea2e6b128fd4d6d3866916d65d89ec743f49621678a5997c0dd3bc0bfe78a25acd72c39d61c5f13523a9f84a9160259966f9408f9c56b109
data/README.md CHANGED
@@ -194,7 +194,7 @@ First bump the version as appropriate in `lib/replica_pools/version.rb` and then
194
194
 
195
195
  Author: Dan Drabik, Lance Ivy
196
196
 
197
- Copyright (c) 2012-2019, Kickstarter
197
+ Copyright (c) 2012-2021, Kickstarter
198
198
 
199
199
  Released under the MIT license
200
200
 
@@ -24,6 +24,8 @@ module ReplicaPools
24
24
  # there may be more args for Rails 5.0+, but we only care about arel, name, and binds for caching.
25
25
  relation, name, raw_binds = args
26
26
 
27
+ # Rails 6.2 breaks this method as locked? is no longer available
28
+ # https://github.com/kickstarter/replica_pools/issues/26
27
29
  if !query_cache_enabled || locked?(relation)
28
30
  return route_to(current, :select_all, *args)
29
31
  end
@@ -32,7 +34,7 @@ module ReplicaPools
32
34
  if raw_binds.blank? && relation.is_a?(ActiveRecord::Relation)
33
35
  arel, binds = relation.arel, relation.bind_values
34
36
  else
35
- arel, binds = relation, raw_binds
37
+ arel, binds = relation, Array(raw_binds)
36
38
  end
37
39
 
38
40
  sql = to_sql(arel, binds)
@@ -1,3 +1,3 @@
1
1
  module ReplicaPools
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'rack'
2
2
  require_relative 'spec_helper'
3
+ require_relative 'config/test_model'
3
4
 
4
5
  describe ReplicaPools::QueryCache do
5
6
  before(:each) do
@@ -103,4 +104,16 @@ describe ReplicaPools::QueryCache do
103
104
  end
104
105
  end
105
106
  end
107
+
108
+ describe '.pluck regression test' do
109
+ it 'should work with query caching' do
110
+ TestModel.connection.enable_query_cache!
111
+ expect(TestModel.pluck(:id).count).to eql TestModel.all.count
112
+ end
113
+
114
+ it 'should work if query cache is not enabled' do
115
+ TestModel.connection.disable_query_cache!
116
+ expect(TestModel.pluck(:id).count).to eql TestModel.all.count
117
+ end
118
+ end
106
119
  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.2.0
4
+ version: 2.2.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: 2020-01-28 00:00:00.000000000 Z
12
+ date: 2021-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -95,6 +95,20 @@ dependencies:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: pry
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
98
112
  description: Connection proxy for ActiveRecord for leader / replica setups.
99
113
  email: dan@kickstarter.com
100
114
  executables: []
@@ -138,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
152
  - !ruby/object:Gem::Version
139
153
  version: '1.2'
140
154
  requirements: []
141
- rubygems_version: 3.1.2
155
+ rubygems_version: 3.0.3
142
156
  signing_key:
143
157
  specification_version: 4
144
158
  summary: Connection proxy for ActiveRecord for leader / replica setups.