cached_counts 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cached_counts/cache.rb +2 -3
- data/lib/cached_counts/version.rb +1 -1
- metadata +1 -1
data/lib/cached_counts/cache.rb
CHANGED
@@ -10,11 +10,10 @@ module CachedCounts
|
|
10
10
|
|
11
11
|
# Clear out any count caches which have SQL that includes the scopes table
|
12
12
|
def clear
|
13
|
-
|
14
|
-
invalid_keys = keys.select { |key| key.include?(@scope.table_name.downcase.singularize) }
|
13
|
+
invalid_keys = all_keys.select { |key| key.include?(@scope.table_name.downcase.singularize) }
|
15
14
|
invalid_keys.each { |key| Rails.cache.delete(key) }
|
16
15
|
|
17
|
-
Rails.cache.write(list_key,
|
16
|
+
Rails.cache.write(list_key, all_keys - invalid_keys)
|
18
17
|
end
|
19
18
|
|
20
19
|
private
|