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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bf992b2001ae6c7bf6ada58116ae081228ab07c6
4
- data.tar.gz: 0762cdbd9a2ed0924a19cdd9835773250cf5bcba
2
+ SHA256:
3
+ metadata.gz: 9dd0dd86c5ad6cefd608aa32c23077730a3d797a5398e513c5360e7a6bab7d41
4
+ data.tar.gz: a9f4d0895dbc5dd8ebabe4a1419e18a19ff2483d80f1f066703966e8329cc1d6
5
5
  SHA512:
6
- metadata.gz: 365ef8fe72218325265a8a3b563c325de40f81d3c65097798a59fdaa4e504cd10bc74d4888480f8202da17d9c3e9ccc4cce03a5ff288e283469cc5e1e9b57846
7
- data.tar.gz: a56f1bf870d6c334816806bd6712db25f1f6080c5705fbb5104724b8802e192c6580f244436a0ef7012d1a54fdad82b958a21fdc71497a40416c9264dd37a69f
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 => @relation)).group(
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 => @relation).group(
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  class Precounter
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  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.1
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-05-23 00:00:00.000000000 Z
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.13
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