counter_cache_update 0.0.0 → 0.0.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: 612e3322b4f6660aee4c90461cb98dc2a3b7d9d5
|
|
4
|
+
data.tar.gz: 83f8c0cec5da605ff621ce17b7a5220660d1d4a5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fba1046c4769cf685c3c57d9420cfd28f5ebea989900760304eb859ee4e8bc094f31b0697329ccc1a54acff6f865248eb520e81c68790aa240ddb31229283209
|
|
7
|
+
data.tar.gz: e55553d1d386bc0ef45091d6fb23815950f0e92475001c8e67d8445ff24742d37a61f66698a27ec1461382dcf1889dfdd3623883edf53d0cde6125067a7589ec
|
|
@@ -24,15 +24,15 @@ private
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def count_sql
|
|
27
|
-
"SELECT COUNT(*) FROM #{reflection_table_name} WHERE #{reflection_table_name}.#{
|
|
27
|
+
"SELECT COUNT(*) FROM #{reflection_table_name} WHERE #{reflection_table_name}.#{relation_foreign_key} = #{table_name}.#{primary_key}"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def primary_key
|
|
31
31
|
model_class.primary_key
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def
|
|
35
|
-
reflection.
|
|
34
|
+
def relation_foreign_key
|
|
35
|
+
reflection.foreign_key
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def reflection_table_name
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: counter_cache_update
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kaspernj
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-03-
|
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|