incrdecr_cached_counts 0.6.0 → 0.8.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 +4 -4
- data/lib/cached_counts/version.rb +1 -1
- data/lib/cached_counts.rb +2 -2
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c58fdc2af497828ca339a588f84ab65f74a65eee44d80b3564027ca7e0aba34b
|
4
|
+
data.tar.gz: 6b13ec10e6fd26c337220a0c724bfbc7eace302633102236c3243af25f6e9c66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 644582f37233f789b4c69cac9d1a67a4c56d5519017260ecaa39e79bbcbd49d92931ec12df175399d81bc8b5fc90ad340c18b695de49dfcefe608eb0768d1c91
|
7
|
+
data.tar.gz: 998a315221431f9865d05bb2bf8ec07b507a7b8e490422661adf837836d5fc96dc23953aca19e68d6112a819373479e8cd76cfe2a497726fa90f94d600272406
|
data/lib/cached_counts.rb
CHANGED
@@ -156,7 +156,7 @@ module CachedCounts
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def default_race_condition_fallback_proc(key, relation, options)
|
159
|
-
fallback = Rails.cache.read(key)
|
159
|
+
fallback = Rails.cache.read(key, raw: true)
|
160
160
|
fallback = fallback.value if fallback.is_a?(ActiveSupport::Cache::Entry)
|
161
161
|
|
162
162
|
-> { fallback }
|
@@ -176,7 +176,7 @@ module CachedCounts
|
|
176
176
|
|
177
177
|
# Try to fetch values for ids from the cache. If it's a miss return the default value
|
178
178
|
define_singleton_method "try_#{attr_name}_counts_for" do |ids, default=nil|
|
179
|
-
raw_result = Rails.cache.read_multi(*ids.map{|id| association_count_key(id, attribute_name, version)})
|
179
|
+
raw_result = Rails.cache.read_multi(*ids.map{|id| association_count_key(id, attribute_name, version)}, raw: true)
|
180
180
|
|
181
181
|
result = {}
|
182
182
|
ids.each do |id|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: incrdecr_cached_counts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Judd
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-30 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rails
|
@@ -128,7 +127,6 @@ homepage: https://github.com/academia-edu/cached_counts
|
|
128
127
|
licenses:
|
129
128
|
- MIT
|
130
129
|
metadata: {}
|
131
|
-
post_install_message:
|
132
130
|
rdoc_options: []
|
133
131
|
require_paths:
|
134
132
|
- lib
|
@@ -143,8 +141,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
141
|
- !ruby/object:Gem::Version
|
144
142
|
version: '0'
|
145
143
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
147
|
-
signing_key:
|
144
|
+
rubygems_version: 3.6.3
|
148
145
|
specification_version: 4
|
149
146
|
summary: A replacement for Rails' counter caches using memcached (via Dalli)
|
150
|
-
test_files:
|
147
|
+
test_files:
|
148
|
+
- spec/caches_count_of_spec.rb
|
149
|
+
- spec/caches_count_where_spec.rb
|
150
|
+
- spec/database.yml
|
151
|
+
- spec/fixtures.rb
|
152
|
+
- spec/fixtures/department.rb
|
153
|
+
- spec/fixtures/following.rb
|
154
|
+
- spec/fixtures/university.rb
|
155
|
+
- spec/fixtures/user.rb
|
156
|
+
- spec/spec_helper.rb
|