activerecord-precounter 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -0
- data/activerecord-precounter.gemspec +1 -1
- data/ci/Gemfile.activerecord-5.2.x +4 -0
- data/lib/active_record/precounter.rb +1 -1
- data/lib/active_record/precounter/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5a98de667f01aff0aba4a22a8c277d590e830bcd4f065e2f1c97b7be947fa536
|
4
|
+
data.tar.gz: 53802ab51ac776f37f9b580dc1601091c06db4be24673bc6265452bd31ea8772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ed26cb10c38c529ea1fa6d0eb07c454eb1e81e932d07ff6f2e7794f20d1c2696c78159b6130df5bcff68a7201d0c03705a16ce3c7f135ff6c1111cdf52dcd30
|
7
|
+
data.tar.gz: 7da3ca43d5bbb85820c2ee586d5e8244504c823074cf8af92f38a2651c850ad8be4cb80ccbd19302d546319b511773c5abb6fca369acf590b176ec773429220c
|
data/.travis.yml
CHANGED
@@ -7,9 +7,15 @@ branches:
|
|
7
7
|
- master
|
8
8
|
matrix:
|
9
9
|
include:
|
10
|
+
- rvm: 2.4.1
|
11
|
+
env: TASK=spec ARCONN=postgresql
|
12
|
+
gemfile: ci/Gemfile.activerecord-5.0.x
|
10
13
|
- rvm: 2.4.1
|
11
14
|
env: TASK=spec ARCONN=sqlite3
|
12
15
|
gemfile: ci/Gemfile.activerecord-5.1.x
|
13
16
|
- rvm: 2.4.1
|
14
17
|
env: TASK=spec ARCONN=postgresql
|
15
18
|
gemfile: ci/Gemfile.activerecord-5.1.x
|
19
|
+
- rvm: 2.4.1
|
20
|
+
env: TASK=spec ARCONN=postgresql
|
21
|
+
gemfile: ci/Gemfile.activerecord-5.2.x
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ['lib']
|
23
23
|
|
24
|
-
spec.add_dependency 'activerecord'
|
24
|
+
spec.add_dependency 'activerecord', '>= 5'
|
25
25
|
spec.add_development_dependency 'bundler'
|
26
26
|
spec.add_development_dependency 'mysql2'
|
27
27
|
spec.add_development_dependency 'postgres'
|
@@ -27,7 +27,7 @@ module ActiveRecord
|
|
27
27
|
end
|
28
28
|
|
29
29
|
count_by_id = if reflection.has_scope?
|
30
|
-
reflection.scope_for(reflection.klass
|
30
|
+
reflection.scope_for(reflection.klass.unscoped.where(reflection.inverse_of.name => records.map(&:id))).group(
|
31
31
|
reflection.inverse_of.foreign_key
|
32
32
|
).count
|
33
33
|
else
|
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.
|
4
|
+
version: 0.3.0
|
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-
|
11
|
+
date: 2018-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- ci/Gemfile.activerecord-4.2.x
|
129
129
|
- ci/Gemfile.activerecord-5.0.x
|
130
130
|
- ci/Gemfile.activerecord-5.1.x
|
131
|
+
- ci/Gemfile.activerecord-5.2.x
|
131
132
|
- ci/travis.rb
|
132
133
|
- lib/active_record/precounter.rb
|
133
134
|
- lib/active_record/precounter/version.rb
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: '0'
|
153
154
|
requirements: []
|
154
155
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.6
|
156
|
+
rubygems_version: 2.7.6
|
156
157
|
signing_key:
|
157
158
|
specification_version: 4
|
158
159
|
summary: Yet Another N+1 COUNT Query Killer for ActiveRecord
|