deep_pluck 1.1.7 → 1.2.1

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
2
  SHA256:
3
- metadata.gz: 6e7d7f2e3046068becf1488f871fa7c6dca77a49d96e5d73dc28fc04990f4f3c
4
- data.tar.gz: 0316dc765cd0c74f9ccc2620a6134858737ea79f289237d7228e627429cb7bda
3
+ metadata.gz: 005fdc992119dbb5eceeb1f62ad7ab4c884af86cf556dacba454eb389f45ec7b
4
+ data.tar.gz: bd2e0b8915f71a956238bf2b2a6cd32243c5bf7c18374fd5b0111c20f5550100
5
5
  SHA512:
6
- metadata.gz: a4adb7b51b8574b0beed0dd77dafd6fc6a95b2b783bdb6f4b657452551c9527c9466be49d62f4fc3340c00c9a52db649f350f8350587f652ed0053c31ad97c10
7
- data.tar.gz: 5c1ef10f49b8f35e08d31098ab2a0b9069ab04302c1f4ba7d781cd3d7e2331dfcff6c95adcf739d31c160023e013e1582ae43dff3ab1e966da0ddef5a483707a
6
+ metadata.gz: 3fc6109cac1f4afbd414d63aa5b92fda46ec48fde691d5456c8e6d71582e8bd01dbffdf4f1244e2c825a7790f3278113ceafecc6166fcd8aea80fc84e2c66fb7
7
+ data.tar.gz: 04c2c14548aaee28873a2167cd88ab86cab91143bc315b717d03446e10357c22247d5db851c8b577aedb3ef6961b5a4a411c9f83eb172b146b3f606ed9d89220
@@ -20,9 +20,11 @@ jobs:
20
20
  fail-fast: false
21
21
  matrix:
22
22
  ruby:
23
- - 2.2
23
+ - 2.3
24
24
  - 2.6
25
25
  - 2.7
26
+ - 3.0
27
+ - 3.1
26
28
  gemfile:
27
29
  - 3.2.gemfile
28
30
  - 4.2.gemfile
@@ -31,32 +33,57 @@ jobs:
31
33
  - 5.2.gemfile
32
34
  - 6.0.gemfile
33
35
  - 6.1.gemfile
36
+ - 7.0.gemfile
34
37
  exclude:
35
38
  - gemfile: 3.2.gemfile
36
39
  ruby: 2.6
37
40
  - gemfile: 3.2.gemfile
38
41
  ruby: 2.7
42
+ - gemfile: 3.2.gemfile
43
+ ruby: 3.0
44
+ - gemfile: 3.2.gemfile
45
+ ruby: 3.1
39
46
  - gemfile: 4.2.gemfile
40
47
  ruby: 2.7
48
+ - gemfile: 4.2.gemfile
49
+ ruby: 3.0
50
+ - gemfile: 4.2.gemfile
51
+ ruby: 3.1
52
+ - gemfile: 5.0.gemfile
53
+ ruby: 3.0
54
+ - gemfile: 5.0.gemfile
55
+ ruby: 3.1
56
+ - gemfile: 5.1.gemfile
57
+ ruby: 3.0
58
+ - gemfile: 5.1.gemfile
59
+ ruby: 3.1
60
+ - gemfile: 5.2.gemfile
61
+ ruby: 3.0
62
+ - gemfile: 5.2.gemfile
63
+ ruby: 3.1
41
64
  - gemfile: 6.0.gemfile
42
- ruby: 2.2
65
+ ruby: 2.3
43
66
  - gemfile: 6.1.gemfile
44
- ruby: 2.2
67
+ ruby: 2.3
68
+ - gemfile: 7.0.gemfile
69
+ ruby: 2.3
70
+ - gemfile: 7.0.gemfile
71
+ ruby: 2.6
45
72
  env:
46
73
  BUNDLE_GEMFILE: "gemfiles/${{ matrix.gemfile }}"
47
74
 
48
75
  steps:
49
- - name: Checkout
50
- uses: actions/checkout@v2
51
- - name: Setup Ruby
52
- uses: ruby/setup-ruby@v1
53
- with:
54
- ruby-version: ${{ matrix.ruby }}
55
- bundler-cache: true # runs 'bundle install' and caches installed gems automatically
56
- - name: Run tests
57
- run: bundle exec rake
58
- - name: Publish code coverage
59
- if: ${{ success() && github.event.pull_request.head.repo.full_name == github.repository }}
60
- uses: paambaati/codeclimate-action@v2.7.5
61
- env:
62
- CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
76
+ - name: Checkout
77
+ uses: actions/checkout@v2
78
+ - name: Setup Ruby
79
+ uses: ruby/setup-ruby@v1
80
+ with:
81
+ ruby-version: ${{ matrix.ruby }}
82
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
83
+ - name: Run tests
84
+ run: bundle exec rake
85
+ - name: Publish code coverage
86
+ if: ${{ success() }}
87
+ uses: paambaati/codeclimate-action@v2.7.5
88
+ env:
89
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## Change Log
2
2
 
3
+ ### [v1.2.0](https://github.com/khiav223577/deep_pluck/compare/v1.1.7...v1.2.0) 2021/06/10
4
+ - [#50](https://github.com/khiav223577/deep_pluck/pull/50) Support `globalize` gem (@khiav223577)
5
+
6
+ ### [v1.1.7](https://github.com/khiav223577/deep_pluck/compare/v1.1.6...v1.1.7) 2021/04/10
7
+ - [#48](https://github.com/khiav223577/deep_pluck/pull/48) Fix: joins incorrect table when doing inverse lookup for HABTM associations with custom name (@khiav223577)
8
+ - [#45](https://github.com/khiav223577/deep_pluck/pull/45) Do not publish code coverage for PRs from forks (@moon-moon-husky)
9
+
3
10
  ### [v1.1.6](https://github.com/khiav223577/deep_pluck/compare/v1.1.5...v1.1.6) 2021/02/09
4
11
  - [#43](https://github.com/khiav223577/deep_pluck/pull/43) Fix has_and_belongs_to_many issues when it does not specify "through" table (@khiav223577)
5
12
  - [#42](https://github.com/khiav223577/deep_pluck/pull/42) Migrating from Travis CI to GitHub Actions (@khiav223577)
data/README.md CHANGED
@@ -9,8 +9,8 @@
9
9
  Allow you to pluck deeply into nested associations without loading a bunch of records.
10
10
 
11
11
  ## Supports
12
- - Ruby 2.2 ~ 2.7
13
- - Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0
12
+ - Ruby 2.3 ~ 2.7, 3.0 ~ 3.1
13
+ - Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0, 7.0
14
14
 
15
15
  ## Installation
16
16
 
data/deep_pluck.gemspec CHANGED
@@ -40,6 +40,6 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency 'minitest', '~> 5.0'
41
41
 
42
42
  spec.add_dependency 'activerecord', '>= 3'
43
- spec.add_dependency 'pluck_all', '>= 1.2.3'
44
- spec.add_dependency 'rails_compatibility', '>= 0.0.4'
43
+ spec.add_dependency 'pluck_all', '>= 2.3.2'
44
+ spec.add_dependency 'rails_compatibility', '>= 0.0.8'
45
45
  end
data/gemfiles/3.2.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 3.2.0'
4
- gem 'pluck_all', '~> 1.2.2'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/4.2.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 4.2.0'
4
- gem 'pluck_all', '~> 1.2.2'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/5.0.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 5.0.0'
4
- gem 'pluck_all', '~> 1.2.2'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/5.1.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 5.1.0'
4
- gem 'pluck_all', '~> 1.2.2'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/5.2.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 5.2.0'
4
- gem 'pluck_all', '~> 1.2.2'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/6.0.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 6.0.0'
4
- gem 'pluck_all', '~> 2.0.4'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
data/gemfiles/6.1.gemfile CHANGED
@@ -1,7 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activerecord', '~> 6.1.1'
4
- gem 'pluck_all', '~> 2.2.1'
4
+ gem 'pluck_all', '~> 2.3.2'
5
+
6
+ gem 'globalize'
5
7
 
6
8
  group :test do
7
9
  gem 'simplecov', '< 0.18'
@@ -0,0 +1,14 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'zeitwerk'
4
+ gem 'activerecord', '~> 7.0.0'
5
+ gem 'pluck_all', '~> 2.3.2'
6
+
7
+ # gem 'globalize', '~> 6.0.1' # TODO: wait for globalize to support Rails 7.
8
+
9
+ group :test do
10
+ gem 'simplecov', '< 0.18'
11
+ gem 'sqlite3', '~> 1.4.1'
12
+ end
13
+
14
+ gemspec path: '../'
@@ -50,6 +50,8 @@ module DeepPluck
50
50
  end
51
51
 
52
52
  def get_primary_key(reflect)
53
+ options = reflect.options
54
+ return options[:primary_key] if options[:primary_key]
53
55
  return (reflect.belongs_to? ? reflect.klass : reflect.active_record).primary_key
54
56
  end
55
57
 
@@ -1,3 +1,3 @@
1
1
  module DeepPluck
2
- VERSION = '1.1.7'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_pluck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-10 00:00:00.000000000 Z
11
+ date: 2023-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 1.2.3
95
+ version: 2.3.2
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: 1.2.3
102
+ version: 2.3.2
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rails_compatibility
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: 0.0.4
109
+ version: 0.0.8
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: 0.0.4
116
+ version: 0.0.8
117
117
  description: 'Use deep_pluck as a shortcut to select one or more attributes and include
118
118
  associated models without loading a bunch of records. And DRY up your code when
119
119
  using #as_json.'
@@ -142,6 +142,7 @@ files:
142
142
  - gemfiles/5.2.gemfile
143
143
  - gemfiles/6.0.gemfile
144
144
  - gemfiles/6.1.gemfile
145
+ - gemfiles/7.0.gemfile
145
146
  - lib/deep_pluck.rb
146
147
  - lib/deep_pluck/data_combiner.rb
147
148
  - lib/deep_pluck/model.rb