identity_cache 1.5.1 → 1.5.2

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: 74ac4689e3399b1aa302326508b6098665ced3f516637901e87c0a3e12005680
4
- data.tar.gz: e4e5a009cd8820ba6110a750de6069d3f4735673f22111a09a8e86d4f7a6fd85
3
+ metadata.gz: 25effde8c6f5f470a9e90f18a17b89ed2c12f4d3191e0c05110568acdcb2153c
4
+ data.tar.gz: ff299911448670f58000ca5f047d4a9bbd04fe00452392eb698232a40d244e74
5
5
  SHA512:
6
- metadata.gz: 8bbe844d4a663b8de0ae1d5231687c3113a13d6922287516d70db5a0dcc11556f3e0529c9353566c06edb6dbeff77cf3f675607440dbe5f266f44c2c72f49fee
7
- data.tar.gz: 447b2c17d61f17012f7100bbee16e063adfc0d9957a4eae0a2b117f7b81a7f5b6083fdc6ecc53bddb7a4204317acbd1a17cc04c3a95f40916df7a16995060fe0
6
+ metadata.gz: 1b861f668ca23a245b16c6ac4d3a8a2b80d954386f67607bca8ce51507d7c3fcb8852d419e38e4c15f5999c8614fb7a5e2661d78687ea510b73f83d107a58c9e
7
+ data.tar.gz: dd2a1b9fa974aa139eb99b6e2bc718ee7725b15f54998a125bea2b552b4dfe7de537d9c216516ffb0419daecb40c762debff1c17fcbf973eb42b0344af7bb2ad
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.5.2
6
+
7
+ - Add missing `should_use_cache?` to `fetch_multi` methods.
8
+
5
9
  ## 1.5.1
6
10
 
7
11
  - Fix parent cache invalidation for custom foreign key associations
@@ -65,9 +65,13 @@ module IdentityCache
65
65
  end
66
66
 
67
67
  def fetch_multi(keys, &block)
68
- results = cas_multi(keys, &block)
69
- results = add_multi(keys, &block) if results.nil?
70
- results
68
+ if IdentityCache.should_use_cache?
69
+ results = cas_multi(keys, &block)
70
+ results = add_multi(keys, &block) if results.nil?
71
+ results
72
+ else
73
+ {}
74
+ end
71
75
  end
72
76
 
73
77
  def fetch(key, fill_lock_duration: nil, lock_wait_tries: 2, &block)
@@ -21,7 +21,11 @@ module IdentityCache
21
21
  end
22
22
 
23
23
  def fetch_multi(keys)
24
- results = @cache_backend.read_multi(*keys)
24
+ results = if IdentityCache.should_use_cache?
25
+ @cache_backend.read_multi(*keys)
26
+ else
27
+ {}
28
+ end
25
29
  missed_keys = keys - results.keys
26
30
  unless missed_keys.empty?
27
31
  replacement_results = yield missed_keys
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IdentityCache
4
- VERSION = "1.5.1"
4
+ VERSION = "1.5.2"
5
5
  CACHE_VERSION = 8
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: identity_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Lopez
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2023-12-04 00:00:00.000000000 Z
17
+ date: 2023-12-15 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.4.21
193
+ rubygems_version: 3.4.22
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: IdentityCache lets you specify how you want to cache your model objects,