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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c3c08d0e856aad769711131f6e7276b777e2f6cd
4
- data.tar.gz: 6648ad8319c9bd466b0693b2d3386c19f74e2d37
2
+ SHA256:
3
+ metadata.gz: 5a98de667f01aff0aba4a22a8c277d590e830bcd4f065e2f1c97b7be947fa536
4
+ data.tar.gz: 53802ab51ac776f37f9b580dc1601091c06db4be24673bc6265452bd31ea8772
5
5
  SHA512:
6
- metadata.gz: 966efeff214aa006d5d272afd5197d80a64f93df982ddd8e0302b0326c182024961d50cc9f519f79821f5da651a5d2a23f8ae7e9a11efee663cf0a5bd5199891
7
- data.tar.gz: 9df24ac11ae3cfdd91037422b94e4fd3e9b40da5e21fee2a1cb6c42f3651891f389816537e81154ab56d74f5d9b1016f4ec87a7ece58a8901bad60e60955b139
6
+ metadata.gz: 3ed26cb10c38c529ea1fa6d0eb07c454eb1e81e932d07ff6f2e7794f20d1c2696c78159b6130df5bcff68a7201d0c03705a16ce3c7f135ff6c1111cdf52dcd30
7
+ data.tar.gz: 7da3ca43d5bbb85820c2ee586d5e8244504c823074cf8af92f38a2651c850ad8be4cb80ccbd19302d546319b511773c5abb6fca369acf590b176ec773429220c
@@ -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'
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rails', '~> 5.2.0'
4
+ gemspec path: '..'
@@ -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).where(reflection.inverse_of.name => records.map(&:id)).group(
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
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  class Precounter
3
- VERSION = '0.2.3'
3
+ VERSION = '0.3.0'
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.3
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-06 00:00:00.000000000 Z
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: '0'
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: '0'
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.13
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