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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d5bd60c008ad0b41a08214d9243ebb6278467bb3ca2b5f3314609c5361b6c1a
4
- data.tar.gz: cea01587597deb81ff143e8383a194238a00e36c2e2529760aec60a83f485b5c
3
+ metadata.gz: c58fdc2af497828ca339a588f84ab65f74a65eee44d80b3564027ca7e0aba34b
4
+ data.tar.gz: 6b13ec10e6fd26c337220a0c724bfbc7eace302633102236c3243af25f6e9c66
5
5
  SHA512:
6
- metadata.gz: a8e9a0efe389831ae4f8d28db0cc23f2b873c705231fed8caa80ee322e84abf0d0998f6f3d777a8e7ce565ce0c2770ab3438322ff50a2921349d3d9e4f81dac6
7
- data.tar.gz: b8fdd83b366cc6827cf925bfb003a065a2139ab98a103b9cb2ad9daac89f421fd3110328d80e5c6910caa7ce9322c06791c67b3d64caf66c5d030e41cbdd1b35
6
+ metadata.gz: 644582f37233f789b4c69cac9d1a67a4c56d5519017260ecaa39e79bbcbd49d92931ec12df175399d81bc8b5fc90ad340c18b695de49dfcefe608eb0768d1c91
7
+ data.tar.gz: 998a315221431f9865d05bb2bf8ec07b507a7b8e490422661adf837836d5fc96dc23953aca19e68d6112a819373479e8cd76cfe2a497726fa90f94d600272406
@@ -1,3 +1,3 @@
1
1
  module CachedCounts
2
- VERSION = "0.6.0"
2
+ VERSION = "0.8.0"
3
3
  end
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.6.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: 2022-07-14 00:00:00.000000000 Z
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.1.4
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