counter_cache-rails 0.4.0 → 0.4.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d0efcf3589cb3d2f0f2a5fd63b878bd8146501
|
4
|
+
data.tar.gz: e609bd73d046a451134e94d9801ed3376158924c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6243a745cd31578e3e925d36d26de25e402a531a5dd1a4a94e76c9d9dd397858cc781c46e964b6ad2d11cb054e776b69f03ac8153da641ab43cb7926808b939e
|
7
|
+
data.tar.gz: 28af17d6cf549d993ef492957d34aed05f07337950c901dcf673ed25f5196d56d9a38b43b677cffe3884e60db2b88cd2bd5246353044c942d5339214871e514c
|
@@ -47,7 +47,8 @@ module CounterCacheRails
|
|
47
47
|
define_method "_#{tableized_child_model}_count_incr" do
|
48
48
|
run_callbacks callback_names[:update] do
|
49
49
|
run_callbacks callback_names[:increment] do
|
50
|
-
|
50
|
+
key = _counter_cache_key(class_name, primary_key, tableized_child_model)
|
51
|
+
Rails.cache.exist?(key) ? Rails.cache.increment(key) : send("#{tableized_child_model}_count")
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|
@@ -55,7 +56,8 @@ module CounterCacheRails
|
|
55
56
|
define_method "_#{tableized_child_model}_count_decr" do
|
56
57
|
run_callbacks callback_names[:update] do
|
57
58
|
run_callbacks callback_names[:decrement] do
|
58
|
-
|
59
|
+
key = _counter_cache_key(class_name, primary_key, tableized_child_model)
|
60
|
+
Rails.cache.exist?(key) ? Rails.cache.decrement(key) : send("#{tableized_child_model}_count")
|
59
61
|
end
|
60
62
|
end
|
61
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: counter_cache-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Iguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|