deep_pluck 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +6 -1
- data/CHANGELOG.md +94 -78
- data/README.md +1 -1
- data/deep_pluck.gemspec +1 -1
- data/gemfiles/7.0.gemfile +2 -2
- data/gemfiles/7.1.gemfile +14 -0
- data/lib/deep_pluck/model.rb +2 -1
- data/lib/deep_pluck/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ccf8d7148c3cc85af9e85d04417e445a7f67bbe8c6d7feabfef12fbce6207a9
|
4
|
+
data.tar.gz: 2999ce4ea1a1224f9618f56014926887352bae0e3a6724073d518ddc64c99e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92f37c683aa8dab7c73555bb03e35ec3791a7eeebcba494af915efb3490e946785995b0a21cfc5f7ee5acd90b5479b99963dc05b327266d89ad1ccce5622719
|
7
|
+
data.tar.gz: 986d208e8861aae0536584add5703813c8a1b3572af9ed82705a0904536ff28b6f69041c84c6ad5e13043a14b9dcfbe53853250bd8d4969857d566cf19afb5a6
|
data/.github/workflows/ruby.yml
CHANGED
@@ -34,6 +34,7 @@ jobs:
|
|
34
34
|
- 6.0.gemfile
|
35
35
|
- 6.1.gemfile
|
36
36
|
- 7.0.gemfile
|
37
|
+
- 7.1.gemfile
|
37
38
|
exclude:
|
38
39
|
- gemfile: 3.2.gemfile
|
39
40
|
ruby: 2.6
|
@@ -69,6 +70,10 @@ jobs:
|
|
69
70
|
ruby: 2.3
|
70
71
|
- gemfile: 7.0.gemfile
|
71
72
|
ruby: 2.6
|
73
|
+
- gemfile: 7.1.gemfile
|
74
|
+
ruby: 2.3
|
75
|
+
- gemfile: 7.1.gemfile
|
76
|
+
ruby: 2.6
|
72
77
|
env:
|
73
78
|
BUNDLE_GEMFILE: "gemfiles/${{ matrix.gemfile }}"
|
74
79
|
|
@@ -83,7 +88,7 @@ jobs:
|
|
83
88
|
- name: Run tests
|
84
89
|
run: bundle exec rake
|
85
90
|
- name: Publish code coverage
|
86
|
-
if: ${{ success() }}
|
91
|
+
if: ${{ success() && env.CC_TEST_REPORTER_ID }}
|
87
92
|
uses: paambaati/codeclimate-action@v2.7.5
|
88
93
|
env:
|
89
94
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
data/CHANGELOG.md
CHANGED
@@ -1,78 +1,94 @@
|
|
1
|
-
## Change Log
|
2
|
-
|
3
|
-
### [
|
4
|
-
- [#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
- [#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
- [#
|
13
|
-
|
14
|
-
|
15
|
-
- [#
|
16
|
-
- [#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- [#
|
21
|
-
|
22
|
-
### [v1.1.
|
23
|
-
- [#
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- [#
|
28
|
-
- [#
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- [#
|
36
|
-
- [#
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
- [#
|
43
|
-
|
44
|
-
|
45
|
-
- [#
|
46
|
-
- [#
|
47
|
-
|
48
|
-
### [v1.
|
49
|
-
- [#
|
50
|
-
|
51
|
-
|
52
|
-
- [#
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
- [#
|
73
|
-
|
74
|
-
### [v0.
|
75
|
-
- [#
|
76
|
-
|
77
|
-
|
78
|
-
|
1
|
+
## Change Log
|
2
|
+
|
3
|
+
### [upcoming](https://github.com/khiav223577/deep_pluck/compare/v1.3.0...HEAD) 2023/12/24
|
4
|
+
- [#61](https://github.com/khiav223577/deep_pluck/pull/61) Skip the step of publishing code coverage for the PR from forked repos (@khiav223577)
|
5
|
+
- [#59](https://github.com/khiav223577/deep_pluck/pull/59) Fix: missing data caused by wrong association definition in test cases (@khiav223577)
|
6
|
+
|
7
|
+
### [v1.3.0](https://github.com/khiav223577/deep_pluck/compare/v1.2.1...v1.3.0) 2023/08/10
|
8
|
+
- [#58](https://github.com/khiav223577/deep_pluck/pull/58) add frozen_string_literal (@khiav223577)
|
9
|
+
- [#57](https://github.com/khiav223577/deep_pluck/pull/57) Always show the association key even if there is no data (@khiav223577)
|
10
|
+
|
11
|
+
### [v1.2.1](https://github.com/khiav223577/deep_pluck/compare/v1.2.0...v1.2.1) 2023/08/06
|
12
|
+
- [#56](https://github.com/khiav223577/deep_pluck/pull/56) Fix: deep_pluck at has_many association with primary_key options will fail (@khiav223577)
|
13
|
+
- [#55](https://github.com/khiav223577/deep_pluck/pull/55) Drop the support of ruby 2.2 (@khiav223577)
|
14
|
+
- [#54](https://github.com/khiav223577/deep_pluck/pull/54) Refactor: use gem to setup autoload paths in tests (@khiav223577)
|
15
|
+
- [#53](https://github.com/khiav223577/deep_pluck/pull/53) Support Rails 7.0 (@khiav223577)
|
16
|
+
- [#52](https://github.com/khiav223577/deep_pluck/pull/52) Support Ruby 3.1 (@khiav223577)
|
17
|
+
- [#51](https://github.com/khiav223577/deep_pluck/pull/51) Support Ruby 3.0 (@khiav223577)
|
18
|
+
|
19
|
+
### [v1.2.0](https://github.com/khiav223577/deep_pluck/compare/v1.1.7...v1.2.0) 2021/06/10
|
20
|
+
- [#50](https://github.com/khiav223577/deep_pluck/pull/50) Support `globalize` gem (@khiav223577)
|
21
|
+
|
22
|
+
### [v1.1.7](https://github.com/khiav223577/deep_pluck/compare/v1.1.6...v1.1.7) 2021/04/10
|
23
|
+
- [#48](https://github.com/khiav223577/deep_pluck/pull/48) Fix: joins incorrect table when doing inverse lookup for HABTM associations with custom name (@khiav223577)
|
24
|
+
- [#45](https://github.com/khiav223577/deep_pluck/pull/45) Do not publish code coverage for PRs from forks (@moon-moon-husky)
|
25
|
+
|
26
|
+
### [v1.1.6](https://github.com/khiav223577/deep_pluck/compare/v1.1.5...v1.1.6) 2021/02/09
|
27
|
+
- [#43](https://github.com/khiav223577/deep_pluck/pull/43) Fix has_and_belongs_to_many issues when it does not specify "through" table (@khiav223577)
|
28
|
+
- [#42](https://github.com/khiav223577/deep_pluck/pull/42) Migrating from Travis CI to GitHub Actions (@khiav223577)
|
29
|
+
|
30
|
+
### [v1.1.5](https://github.com/khiav223577/deep_pluck/compare/v1.1.4...v1.1.5) 2021/01/10
|
31
|
+
- [#39](https://github.com/khiav223577/deep_pluck/pull/39) Compatibility with Rails 6.1.1 (@klausbadelt)
|
32
|
+
- [#40](https://github.com/khiav223577/deep_pluck/pull/40) Exclude tests from coverage (@klausbadelt)
|
33
|
+
|
34
|
+
### [v1.1.4](https://github.com/khiav223577/deep_pluck/compare/v1.1.3...v1.1.4) 2020/01/13
|
35
|
+
- [#36](https://github.com/khiav223577/deep_pluck/pull/36) A workaround to fix mismatched association named (@khiav223577)
|
36
|
+
- [#35](https://github.com/khiav223577/deep_pluck/pull/35) Support Ruby 2.7 (@khiav223577)
|
37
|
+
|
38
|
+
### [v1.1.3](https://github.com/khiav223577/deep_pluck/compare/v1.1.2...v1.1.3) 2019/12/17
|
39
|
+
- [#34](https://github.com/khiav223577/deep_pluck/pull/34) Support for plucking directly on a has_one through association (@khiav223577)
|
40
|
+
|
41
|
+
### [v1.1.2](https://github.com/khiav223577/deep_pluck/compare/v1.1.1...v1.1.2) 2019/09/25
|
42
|
+
- [#32](https://github.com/khiav223577/deep_pluck/pull/32) Remove unneeded `PreloadedModel` (@khiav223577)
|
43
|
+
- [#31](https://github.com/khiav223577/deep_pluck/pull/31) Support Rails 6.0 (@khiav223577)
|
44
|
+
- [#30](https://github.com/khiav223577/deep_pluck/pull/30) Lock sqlite3 version to 1.3.x (@khiav223577)
|
45
|
+
- [#28](https://github.com/khiav223577/deep_pluck/pull/28) Fix: broken test cases after bundler 2.0 was released (@khiav223577)
|
46
|
+
- [#27](https://github.com/khiav223577/deep_pluck/pull/27) Remove deprecated codeclimate-test-reporter gem and update travis config (@khiav223577)
|
47
|
+
|
48
|
+
### [v1.1.1](https://github.com/khiav223577/deep_pluck/compare/v1.1.0...v1.1.1) 2018/07/08
|
49
|
+
- [#26](https://github.com/khiav223577/deep_pluck/pull/26) Fix: `id` may disappear when plucking at model instance (@khiav223577)
|
50
|
+
- [#25](https://github.com/khiav223577/deep_pluck/pull/25) Refactor - move models definition to separate files (@khiav223577)
|
51
|
+
- [#24](https://github.com/khiav223577/deep_pluck/pull/24) test Rails 5.2 (@khiav223577)
|
52
|
+
- [#23](https://github.com/khiav223577/deep_pluck/pull/23) It should test both 5.0.x and 5.1.x (@khiav223577)
|
53
|
+
- [#22](https://github.com/khiav223577/deep_pluck/pull/22) #deep_pluck at active model without plucking deeply will cause ArgumentError (@khiav223577)
|
54
|
+
- [#20](https://github.com/khiav223577/deep_pluck/pull/20) [ENHANCE] Eliminate Extra Select Loop in Hash Lookup (@berniechiu)
|
55
|
+
|
56
|
+
### [v1.1.0](https://github.com/khiav223577/deep_pluck/compare/v1.0.3...v1.1.0) 2018/02/15
|
57
|
+
- [#19](https://github.com/khiav223577/deep_pluck/pull/19) Support deep_pluck at active model (@khiav223577)
|
58
|
+
- [#18](https://github.com/khiav223577/deep_pluck/pull/18) Add rubocop and Improve code quality (@khiav223577)
|
59
|
+
|
60
|
+
### [v1.0.3](https://github.com/khiav223577/deep_pluck/compare/v1.0.2...v1.0.3) 2017/06/30
|
61
|
+
- [#15](https://github.com/khiav223577/deep_pluck/pull/15) Test deep_pluck in rails 5.1.x (@khiav223577)
|
62
|
+
- [#14](https://github.com/khiav223577/deep_pluck/pull/14) Handle polymorphic associations correctly. (@Bogadon)
|
63
|
+
|
64
|
+
### [v1.0.0](https://github.com/khiav223577/deep_pluck/compare/v0.1.4...v1.0.0) 2017/03/28
|
65
|
+
- [#12](https://github.com/khiav223577/deep_pluck/pull/12) Reduce cyclomatic complexity in model.rb (@khiav223577)
|
66
|
+
|
67
|
+
### [v0.1.4](https://github.com/khiav223577/deep_pluck/compare/v0.1.3...v0.1.4) 2017/03/27
|
68
|
+
- [#11](https://github.com/khiav223577/deep_pluck/pull/11) Fix conditional associations (@khiav223577)
|
69
|
+
|
70
|
+
### [v0.1.3](https://github.com/khiav223577/deep_pluck/compare/v0.1.2...v0.1.3) 2017/03/20
|
71
|
+
- [#10](https://github.com/khiav223577/deep_pluck/pull/10) Fix custom foreign_key, custom primary_key issues (@khiav223577)
|
72
|
+
- [#9](https://github.com/khiav223577/deep_pluck/pull/9) Fix has_and_belongs_to_many (@khiav223577)
|
73
|
+
|
74
|
+
### [v0.1.2](https://github.com/khiav223577/deep_pluck/compare/v0.1.1...v0.1.2) 2017/03/17
|
75
|
+
- [#8](https://github.com/khiav223577/deep_pluck/pull/8) Fix that some need columns are missing (@khiav223577)
|
76
|
+
- [#7](https://github.com/khiav223577/deep_pluck/pull/7) Raise error message when association not found (@khiav223577)
|
77
|
+
|
78
|
+
### [v0.1.1](https://github.com/khiav223577/deep_pluck/compare/v0.1.0...v0.1.1) 2017/03/16
|
79
|
+
- [#6](https://github.com/khiav223577/deep_pluck/pull/6) Fix deep_pluck with #joins (@khiav223577)
|
80
|
+
|
81
|
+
### [v0.1.0](https://github.com/khiav223577/deep_pluck/compare/v0.0.4...v0.1.0) 2017/03/15
|
82
|
+
- [#5](https://github.com/khiav223577/deep_pluck/pull/5) Support pluck many-to-many associations (@khiav223577)
|
83
|
+
|
84
|
+
### [v0.0.4](https://github.com/khiav223577/deep_pluck/compare/v0.0.3...v0.0.4) 2017/03/14
|
85
|
+
- [#4](https://github.com/khiav223577/deep_pluck/pull/4) Fix use deep_pluck on NullRelation will raise exception and prevent unneeded query. (@khiav223577)
|
86
|
+
|
87
|
+
### [v0.0.3](https://github.com/khiav223577/deep_pluck/compare/v0.0.2...v0.0.3) 2017/03/06
|
88
|
+
- [#3](https://github.com/khiav223577/deep_pluck/pull/3) Support more than two level (@khiav223577)
|
89
|
+
|
90
|
+
### [v0.0.2](https://github.com/khiav223577/deep_pluck/compare/v0.0.1...v0.0.2) 2017/03/06
|
91
|
+
- [#2](https://github.com/khiav223577/deep_pluck/pull/2) The result of has_one association should not be array (@khiav223577)
|
92
|
+
|
93
|
+
### v0.0.1 2017/03/04
|
94
|
+
- [#1](https://github.com/khiav223577/deep_pluck/pull/1) Implement deep_pluck (@khiav223577)
|
data/README.md
CHANGED
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', '>= 2.3.
|
43
|
+
spec.add_dependency 'pluck_all', '>= 2.3.4'
|
44
44
|
spec.add_dependency 'rails_compatibility', '>= 0.0.8'
|
45
45
|
end
|
data/gemfiles/7.0.gemfile
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'zeitwerk'
|
4
|
+
gem 'activerecord', '~> 7.1.2'
|
5
|
+
gem 'pluck_all', '~> 2.3.4'
|
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: '../'
|
data/lib/deep_pluck/model.rb
CHANGED
@@ -70,7 +70,8 @@ module DeepPluck
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def get_association_scope(reflect)
|
73
|
-
|
73
|
+
owner = reflect.association_class.new(reflect.active_record.new, reflect)
|
74
|
+
return RailsCompatibility.unscope_where(owner.send(:association_scope))
|
74
75
|
end
|
75
76
|
|
76
77
|
def use_association_to_query?(reflect)
|
data/lib/deep_pluck/version.rb
CHANGED
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.3.
|
4
|
+
version: 1.3.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: 2023-
|
11
|
+
date: 2023-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - ">="
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 2.3.
|
95
|
+
version: 2.3.4
|
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: 2.3.
|
102
|
+
version: 2.3.4
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: rails_compatibility
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +143,7 @@ files:
|
|
143
143
|
- gemfiles/6.0.gemfile
|
144
144
|
- gemfiles/6.1.gemfile
|
145
145
|
- gemfiles/7.0.gemfile
|
146
|
+
- gemfiles/7.1.gemfile
|
146
147
|
- lib/deep_pluck.rb
|
147
148
|
- lib/deep_pluck/data_combiner.rb
|
148
149
|
- lib/deep_pluck/model.rb
|