activerecord-precounter 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/active_record/precounter.rb +2 -2
- data/lib/active_record/precounter/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9dd0dd86c5ad6cefd608aa32c23077730a3d797a5398e513c5360e7a6bab7d41
|
4
|
+
data.tar.gz: a9f4d0895dbc5dd8ebabe4a1419e18a19ff2483d80f1f066703966e8329cc1d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 640b81d1aa59954935e474d54dfee28a941fc0ec31e0d8e0d16e67eedebfc79c54afc90c5c2244edca0954bf9a3dbd1439547d2c54baf9a487d97980ff3559d8
|
7
|
+
data.tar.gz: 92f67fa0ed1709354c2645bbdc39f2fc72dde834dade6b303dbae11f4c32b97599dd6145e76f123c1d46065e80601016cb391d30bb180450629cfbf595379e5a
|
@@ -27,11 +27,11 @@ module ActiveRecord
|
|
27
27
|
end
|
28
28
|
|
29
29
|
count_by_id = if reflection.has_scope?
|
30
|
-
reflection.scope_for(reflection.klass.where(reflection.inverse_of.name =>
|
30
|
+
reflection.scope_for(reflection.klass.where(reflection.inverse_of.name => records.map(&:id))).group(
|
31
31
|
reflection.inverse_of.foreign_key
|
32
32
|
).count
|
33
33
|
else
|
34
|
-
reflection.klass.where(reflection.inverse_of.name =>
|
34
|
+
reflection.klass.where(reflection.inverse_of.name => records.map(&:id)).group(
|
35
35
|
reflection.inverse_of.foreign_key
|
36
36
|
).count
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-precounter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.6
|
155
|
+
rubygems_version: 2.7.6
|
156
156
|
signing_key:
|
157
157
|
specification_version: 4
|
158
158
|
summary: Yet Another N+1 COUNT Query Killer for ActiveRecord
|