ams_lazy_relationships 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -0
- data/Appraisals +16 -0
- data/CHANGELOG.md +39 -6
- data/Gemfile.lock +172 -132
- data/ams_lazy_relationships.gemspec +3 -3
- data/gemfiles/batch_loader_1.gemfile +7 -0
- data/gemfiles/batch_loader_2.gemfile +7 -0
- data/gemfiles/rails_6.gemfile +7 -0
- data/gemfiles/rails_7.gemfile +7 -0
- data/lib/ams_lazy_relationships/core/lazy_dig_method.rb +4 -1
- data/lib/ams_lazy_relationships/core/relationship_wrapper_methods.rb +1 -1
- data/lib/ams_lazy_relationships/loaders/association.rb +14 -3
- data/lib/ams_lazy_relationships/version.rb +1 -1
- metadata +22 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bd7477000acf86df431b18cf326a86424d448ce14cfe042ae4e676fdddb09a
|
4
|
+
data.tar.gz: b9a4939240fa888c0c0e3cd6a17d3fec5acb90a8007cfe435adf5f694f518376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc0fee20d57d9c19627118d5592daf52aaa69547cbb517be838ba317f475b41df076c5f12ee4be75f3e0791a8adab67315ddd3f232a5e57969ab225573e7c819
|
7
|
+
data.tar.gz: 60ac478470ed1ad82bcdd72b94c470d0f6456370b97c9c77f11a6835cc36ff3b2068c7fc71de279d1e559bea2b191a4f0dd73050b159eec9083113d5c4f4dc6d
|
data/.travis.yml
CHANGED
@@ -11,9 +11,23 @@ gemfile:
|
|
11
11
|
- gemfiles/ams_0.10.3.gemfile
|
12
12
|
- gemfiles/ams_0.10.8.gemfile
|
13
13
|
- gemfiles/ams_0.10.10.gemfile
|
14
|
+
- gemfiles/batch_loader_1.gemfile
|
15
|
+
- gemfiles/batch_loader_2.gemfile
|
16
|
+
- gemfiles/rails_6.gemfile
|
17
|
+
- gemfiles/rails_7.gemfile
|
14
18
|
cache: bundler
|
15
19
|
rvm:
|
16
20
|
- 2.5.3
|
21
|
+
- 3.0.0
|
22
|
+
jobs:
|
23
|
+
# Following AMS versions are locked to AR < 6 which isn't compatible with Ruby 3
|
24
|
+
exclude:
|
25
|
+
- rvm: 3.0.0
|
26
|
+
gemfile: gemfiles/ams_0.10.2.gemfile
|
27
|
+
- rvm: 3.0.0
|
28
|
+
gemfile: gemfiles/ams_0.10.3.gemfile
|
29
|
+
- rvm: 3.0.0
|
30
|
+
gemfile: gemfiles/ams_0.10.8.gemfile
|
17
31
|
before_script:
|
18
32
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
19
33
|
- chmod +x ./cc-test-reporter
|
data/Appraisals
CHANGED
@@ -21,3 +21,19 @@ end
|
|
21
21
|
appraise "ams-0.10.10" do
|
22
22
|
gem "active_model_serializers", "0.10.10"
|
23
23
|
end
|
24
|
+
|
25
|
+
appraise "batch-loader-1" do
|
26
|
+
gem "batch-loader", "~> 1"
|
27
|
+
end
|
28
|
+
|
29
|
+
appraise "batch-loader-2" do
|
30
|
+
gem "batch-loader", "~> 2"
|
31
|
+
end
|
32
|
+
|
33
|
+
appraise "rails-6" do
|
34
|
+
gem "activerecord", "~> 6"
|
35
|
+
end
|
36
|
+
|
37
|
+
appraise "rails-7" do
|
38
|
+
gem "activerecord", "~> 7"
|
39
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,33 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [v0.4.0](https://github.com/Bajena/ams_lazy_relationships/tree/v0.4.0) (2023-11-18)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.3.2...v0.4.0)
|
6
|
+
|
7
|
+
**Closed issues:**
|
8
|
+
|
9
|
+
- How do you override association methods? [\#68](https://github.com/Bajena/ams_lazy_relationships/issues/68)
|
10
|
+
- Throws exception in ruby 3.0.0 [\#58](https://github.com/Bajena/ams_lazy_relationships/issues/58)
|
11
|
+
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- Rails 7 support [\#85](https://github.com/Bajena/ams_lazy_relationships/pull/85) ([stokarenko](https://github.com/stokarenko))
|
15
|
+
- Bump addressable from 2.7.0 to 2.8.0 [\#67](https://github.com/Bajena/ams_lazy_relationships/pull/67) ([dependabot[bot]](https://github.com/apps/dependabot))
|
16
|
+
- Bump nokogiri from 1.11.3 to 1.11.4 [\#66](https://github.com/Bajena/ams_lazy_relationships/pull/66) ([dependabot[bot]](https://github.com/apps/dependabot))
|
17
|
+
|
18
|
+
## [v0.3.2](https://github.com/Bajena/ams_lazy_relationships/tree/v0.3.2) (2021-04-18)
|
19
|
+
|
20
|
+
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.3.1...v0.3.2)
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- Support Ruby 3 [\#64](https://github.com/Bajena/ams_lazy_relationships/pull/64) ([Bajena](https://github.com/Bajena))
|
25
|
+
- Bump nokogiri from 1.10.5 to 1.11.3 [\#63](https://github.com/Bajena/ams_lazy_relationships/pull/63) ([dependabot[bot]](https://github.com/apps/dependabot))
|
26
|
+
- Bump json from 2.1.0 to 2.5.1 [\#61](https://github.com/Bajena/ams_lazy_relationships/pull/61) ([dependabot[bot]](https://github.com/apps/dependabot))
|
27
|
+
- Update rake requirement from ~\> 10.0 to ~\> 13.0 [\#53](https://github.com/Bajena/ams_lazy_relationships/pull/53) ([dependabot[bot]](https://github.com/apps/dependabot))
|
2
28
|
|
3
29
|
## [v0.3.1](https://github.com/Bajena/ams_lazy_relationships/tree/v0.3.1) (2021-04-14)
|
30
|
+
|
4
31
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.3.0...v0.3.1)
|
5
32
|
|
6
33
|
**Closed issues:**
|
@@ -12,6 +39,7 @@
|
|
12
39
|
- Lock minimum AMS version to 0.10.0.rc4 [\#60](https://github.com/Bajena/ams_lazy_relationships/pull/60) ([Bajena](https://github.com/Bajena))
|
13
40
|
|
14
41
|
## [v0.3.0](https://github.com/Bajena/ams_lazy_relationships/tree/v0.3.0) (2020-01-16)
|
42
|
+
|
15
43
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.2.0...v0.3.0)
|
16
44
|
|
17
45
|
**Merged pull requests:**
|
@@ -24,13 +52,11 @@
|
|
24
52
|
- Fix documentation for blocked relationships [\#45](https://github.com/Bajena/ams_lazy_relationships/pull/45) ([stokarenko](https://github.com/stokarenko))
|
25
53
|
|
26
54
|
## [v0.2.0](https://github.com/Bajena/ams_lazy_relationships/tree/v0.2.0) (2020-01-11)
|
27
|
-
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.5...v0.2.0)
|
28
55
|
|
29
|
-
|
30
|
-
|
31
|
-
- Lazy dig [\#44](https://github.com/Bajena/ams_lazy_relationships/pull/44) ([stokarenko](https://github.com/stokarenko))
|
56
|
+
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.5...v0.2.0)
|
32
57
|
|
33
58
|
## [v0.1.5](https://github.com/Bajena/ams_lazy_relationships/tree/v0.1.5) (2020-01-08)
|
59
|
+
|
34
60
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.4...v0.1.5)
|
35
61
|
|
36
62
|
**Closed issues:**
|
@@ -52,6 +78,7 @@
|
|
52
78
|
- Bump loofah from 2.2.3 to 2.3.1 [\#31](https://github.com/Bajena/ams_lazy_relationships/pull/31) ([dependabot[bot]](https://github.com/apps/dependabot))
|
53
79
|
|
54
80
|
## [v0.1.4](https://github.com/Bajena/ams_lazy_relationships/tree/v0.1.4) (2019-06-02)
|
81
|
+
|
55
82
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.3...v0.1.4)
|
56
83
|
|
57
84
|
**Closed issues:**
|
@@ -69,6 +96,7 @@
|
|
69
96
|
- Require less restrictive batch loader version [\#26](https://github.com/Bajena/ams_lazy_relationships/pull/26) ([Bajena](https://github.com/Bajena))
|
70
97
|
|
71
98
|
## [v0.1.3](https://github.com/Bajena/ams_lazy_relationships/tree/v0.1.3) (2019-05-19)
|
99
|
+
|
72
100
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/0.1.2...v0.1.3)
|
73
101
|
|
74
102
|
**Closed issues:**
|
@@ -81,6 +109,7 @@
|
|
81
109
|
- Do not yield cached associations data instantly in Association loader [\#23](https://github.com/Bajena/ams_lazy_relationships/pull/23) ([Bajena](https://github.com/Bajena))
|
82
110
|
|
83
111
|
## [0.1.2](https://github.com/Bajena/ams_lazy_relationships/tree/0.1.2) (2019-03-10)
|
112
|
+
|
84
113
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.1...0.1.2)
|
85
114
|
|
86
115
|
**Closed issues:**
|
@@ -94,6 +123,7 @@
|
|
94
123
|
- Fix superclass lazy relationships not loading properly on subclass [\#15](https://github.com/Bajena/ams_lazy_relationships/pull/15) ([willcosgrove](https://github.com/willcosgrove))
|
95
124
|
|
96
125
|
## [v0.1.1](https://github.com/Bajena/ams_lazy_relationships/tree/v0.1.1) (2019-01-09)
|
126
|
+
|
97
127
|
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/v0.1.0...v0.1.1)
|
98
128
|
|
99
129
|
**Merged pull requests:**
|
@@ -101,6 +131,9 @@
|
|
101
131
|
- Relax batch-loader version [\#13](https://github.com/Bajena/ams_lazy_relationships/pull/13) ([Bajena](https://github.com/Bajena))
|
102
132
|
|
103
133
|
## [v0.1.0](https://github.com/Bajena/ams_lazy_relationships/tree/v0.1.0) (2018-12-30)
|
134
|
+
|
135
|
+
[Full Changelog](https://github.com/Bajena/ams_lazy_relationships/compare/a045c7e1c2d545a336cb79fec9e92f0f4c843651...v0.1.0)
|
136
|
+
|
104
137
|
**Closed issues:**
|
105
138
|
|
106
139
|
- Add changelog [\#10](https://github.com/Bajena/ams_lazy_relationships/issues/10)
|
@@ -121,4 +154,4 @@
|
|
121
154
|
|
122
155
|
|
123
156
|
|
124
|
-
\* *This
|
157
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile.lock
CHANGED
@@ -1,147 +1,183 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ams_lazy_relationships (0.
|
4
|
+
ams_lazy_relationships (0.4.0)
|
5
5
|
active_model_serializers (>= 0.10.0.rc4)
|
6
|
-
batch-loader
|
6
|
+
batch-loader
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionpack (
|
12
|
-
actionview (=
|
13
|
-
activesupport (=
|
14
|
-
rack (~> 2.0)
|
11
|
+
actionpack (7.0.8)
|
12
|
+
actionview (= 7.0.8)
|
13
|
+
activesupport (= 7.0.8)
|
14
|
+
rack (~> 2.0, >= 2.2.4)
|
15
15
|
rack-test (>= 0.6.3)
|
16
16
|
rails-dom-testing (~> 2.0)
|
17
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
18
|
-
actionview (
|
19
|
-
activesupport (=
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (7.0.8)
|
19
|
+
activesupport (= 7.0.8)
|
20
20
|
builder (~> 3.1)
|
21
21
|
erubi (~> 1.4)
|
22
22
|
rails-dom-testing (~> 2.0)
|
23
|
-
rails-html-sanitizer (~> 1.
|
24
|
-
active_model_serializers (0.10.
|
25
|
-
actionpack (>= 4.1
|
26
|
-
activemodel (>= 4.1
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
active_model_serializers (0.10.14)
|
25
|
+
actionpack (>= 4.1)
|
26
|
+
activemodel (>= 4.1)
|
27
27
|
case_transform (>= 0.2)
|
28
28
|
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
29
|
-
activemodel (
|
30
|
-
activesupport (=
|
31
|
-
activerecord (
|
32
|
-
activemodel (=
|
33
|
-
activesupport (=
|
34
|
-
|
35
|
-
activesupport (5.2.2)
|
29
|
+
activemodel (7.0.8)
|
30
|
+
activesupport (= 7.0.8)
|
31
|
+
activerecord (7.0.8)
|
32
|
+
activemodel (= 7.0.8)
|
33
|
+
activesupport (= 7.0.8)
|
34
|
+
activesupport (7.0.8)
|
36
35
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
37
|
-
i18n (>=
|
38
|
-
minitest (
|
39
|
-
tzinfo (~>
|
40
|
-
addressable (2.5
|
41
|
-
public_suffix (>= 2.0.2, <
|
42
|
-
appraisal (2.
|
36
|
+
i18n (>= 1.6, < 2)
|
37
|
+
minitest (>= 5.1)
|
38
|
+
tzinfo (~> 2.0)
|
39
|
+
addressable (2.8.5)
|
40
|
+
public_suffix (>= 2.0.2, < 6.0)
|
41
|
+
appraisal (2.5.0)
|
43
42
|
bundler
|
44
43
|
rake
|
45
44
|
thor (>= 0.14.0)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
ast (2.4.2)
|
46
|
+
async (2.6.5)
|
47
|
+
console (~> 1.10)
|
48
|
+
fiber-annotation
|
49
|
+
io-event (~> 1.1)
|
50
|
+
timers (~> 4.1)
|
51
|
+
async-http (0.61.0)
|
52
|
+
async (>= 1.25)
|
53
|
+
async-io (>= 1.28)
|
54
|
+
async-pool (>= 0.2)
|
55
|
+
protocol-http (~> 0.25.0)
|
56
|
+
protocol-http1 (~> 0.16.0)
|
57
|
+
protocol-http2 (~> 0.15.0)
|
58
|
+
traces (>= 0.10.0)
|
59
|
+
async-http-faraday (0.12.0)
|
60
|
+
async-http (~> 0.42)
|
61
|
+
faraday
|
62
|
+
async-io (1.38.0)
|
63
|
+
async
|
64
|
+
async-pool (0.4.0)
|
65
|
+
async (>= 1.25)
|
66
|
+
base64 (0.2.0)
|
67
|
+
batch-loader (2.0.1)
|
68
|
+
benchmark-memory (0.2.0)
|
69
|
+
memory_profiler (~> 1)
|
70
|
+
builder (3.2.4)
|
52
71
|
case_transform (0.2)
|
53
72
|
activesupport
|
54
|
-
coderay (1.1.
|
55
|
-
concurrent-ruby (1.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
73
|
+
coderay (1.1.3)
|
74
|
+
concurrent-ruby (1.2.2)
|
75
|
+
console (1.23.2)
|
76
|
+
fiber-annotation
|
77
|
+
fiber-local
|
78
|
+
crass (1.0.6)
|
79
|
+
db-query-matchers (0.11.0)
|
80
|
+
activesupport (>= 4.0, < 7.1)
|
81
|
+
rspec (>= 3.0)
|
82
|
+
diff-lcs (1.5.0)
|
83
|
+
docile (1.4.0)
|
84
|
+
erubi (1.12.0)
|
85
|
+
faraday (2.7.11)
|
86
|
+
base64
|
87
|
+
faraday-net_http (>= 2.0, < 3.1)
|
88
|
+
ruby2_keywords (>= 0.0.4)
|
89
|
+
faraday-http-cache (2.5.0)
|
90
|
+
faraday (>= 0.8)
|
91
|
+
faraday-net_http (3.0.2)
|
92
|
+
fiber-annotation (0.2.0)
|
93
|
+
fiber-local (1.0.0)
|
94
|
+
github_changelog_generator (1.16.4)
|
68
95
|
activesupport
|
96
|
+
async (>= 1.25.0)
|
97
|
+
async-http-faraday
|
69
98
|
faraday-http-cache
|
70
99
|
multi_json
|
71
100
|
octokit (~> 4.6)
|
72
|
-
rainbow (>= 2.1)
|
101
|
+
rainbow (>= 2.2.1)
|
73
102
|
rake (>= 10.0)
|
74
|
-
|
75
|
-
i18n (1.5.1)
|
103
|
+
i18n (1.14.1)
|
76
104
|
concurrent-ruby (~> 1.0)
|
77
|
-
imagen (0.1.
|
105
|
+
imagen (0.1.8)
|
78
106
|
parser (>= 2.5, != 2.5.1.1)
|
79
|
-
|
80
|
-
|
107
|
+
io-event (1.3.3)
|
108
|
+
jaro_winkler (1.5.6)
|
81
109
|
jsonapi-renderer (0.2.2)
|
82
|
-
loofah (2.
|
110
|
+
loofah (2.22.0)
|
83
111
|
crass (~> 1.0.2)
|
84
|
-
nokogiri (>= 1.
|
85
|
-
memory_profiler (0.
|
86
|
-
method_source (0.
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
powerpack (0.1.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
112
|
+
nokogiri (>= 1.12.0)
|
113
|
+
memory_profiler (1.0.1)
|
114
|
+
method_source (1.0.0)
|
115
|
+
minitest (5.20.0)
|
116
|
+
multi_json (1.15.0)
|
117
|
+
nokogiri (1.15.5-x86_64-darwin)
|
118
|
+
racc (~> 1.4)
|
119
|
+
octokit (4.25.1)
|
120
|
+
faraday (>= 1, < 3)
|
121
|
+
sawyer (~> 0.9)
|
122
|
+
parallel (1.23.0)
|
123
|
+
parser (3.2.2.4)
|
124
|
+
ast (~> 2.4.1)
|
125
|
+
racc
|
126
|
+
powerpack (0.1.3)
|
127
|
+
protocol-hpack (1.4.2)
|
128
|
+
protocol-http (0.25.0)
|
129
|
+
protocol-http1 (0.16.0)
|
130
|
+
protocol-http (~> 0.22)
|
131
|
+
protocol-http2 (0.15.1)
|
132
|
+
protocol-hpack (~> 1.4)
|
133
|
+
protocol-http (~> 0.18)
|
134
|
+
pry (0.14.2)
|
135
|
+
coderay (~> 1.1)
|
136
|
+
method_source (~> 1.0)
|
137
|
+
pry-nav (1.0.0)
|
138
|
+
pry (>= 0.9.10, < 0.15)
|
139
|
+
public_suffix (5.0.4)
|
140
|
+
racc (1.7.3)
|
141
|
+
rack (2.2.8)
|
142
|
+
rack-test (2.1.0)
|
143
|
+
rack (>= 1.3)
|
144
|
+
rails-dom-testing (2.2.0)
|
145
|
+
activesupport (>= 5.0.0)
|
146
|
+
minitest
|
111
147
|
nokogiri (>= 1.6)
|
112
|
-
rails-html-sanitizer (1.0
|
113
|
-
loofah (~> 2.
|
114
|
-
|
115
|
-
|
116
|
-
|
148
|
+
rails-html-sanitizer (1.6.0)
|
149
|
+
loofah (~> 2.21)
|
150
|
+
nokogiri (~> 1.14)
|
151
|
+
railties (7.0.8)
|
152
|
+
actionpack (= 7.0.8)
|
153
|
+
activesupport (= 7.0.8)
|
117
154
|
method_source
|
118
|
-
rake (>=
|
119
|
-
thor (
|
120
|
-
|
121
|
-
|
122
|
-
rake (
|
123
|
-
|
124
|
-
|
125
|
-
rspec-
|
126
|
-
rspec-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
rspec-expectations (3.8.2)
|
155
|
+
rake (>= 12.2)
|
156
|
+
thor (~> 1.0)
|
157
|
+
zeitwerk (~> 2.5)
|
158
|
+
rainbow (3.1.1)
|
159
|
+
rake (13.1.0)
|
160
|
+
rspec (3.9.0)
|
161
|
+
rspec-core (~> 3.9.0)
|
162
|
+
rspec-expectations (~> 3.9.0)
|
163
|
+
rspec-mocks (~> 3.9.0)
|
164
|
+
rspec-core (3.9.3)
|
165
|
+
rspec-support (~> 3.9.3)
|
166
|
+
rspec-expectations (3.9.4)
|
131
167
|
diff-lcs (>= 1.2.0, < 2.0)
|
132
|
-
rspec-support (~> 3.
|
133
|
-
rspec-mocks (3.
|
168
|
+
rspec-support (~> 3.9.0)
|
169
|
+
rspec-mocks (3.9.1)
|
134
170
|
diff-lcs (>= 1.2.0, < 2.0)
|
135
|
-
rspec-support (~> 3.
|
136
|
-
rspec-rails (3.
|
171
|
+
rspec-support (~> 3.9.0)
|
172
|
+
rspec-rails (3.9.1)
|
137
173
|
actionpack (>= 3.0)
|
138
174
|
activesupport (>= 3.0)
|
139
175
|
railties (>= 3.0)
|
140
|
-
rspec-core (~> 3.
|
141
|
-
rspec-expectations (~> 3.
|
142
|
-
rspec-mocks (~> 3.
|
143
|
-
rspec-support (~> 3.
|
144
|
-
rspec-support (3.
|
176
|
+
rspec-core (~> 3.9.0)
|
177
|
+
rspec-expectations (~> 3.9.0)
|
178
|
+
rspec-mocks (~> 3.9.0)
|
179
|
+
rspec-support (~> 3.9.0)
|
180
|
+
rspec-support (3.9.4)
|
145
181
|
rubocop (0.61.0)
|
146
182
|
jaro_winkler (~> 1.5.1)
|
147
183
|
parallel (~> 1.10)
|
@@ -152,33 +188,37 @@ GEM
|
|
152
188
|
unicode-display_width (~> 1.4.0)
|
153
189
|
rubocop-rspec (1.20.1)
|
154
190
|
rubocop (>= 0.51.0)
|
155
|
-
ruby-progressbar (1.
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
191
|
+
ruby-progressbar (1.13.0)
|
192
|
+
ruby2_keywords (0.0.5)
|
193
|
+
rugged (1.6.3)
|
194
|
+
sawyer (0.9.2)
|
195
|
+
addressable (>= 2.3.5)
|
196
|
+
faraday (>= 0.17.3, < 3)
|
197
|
+
simplecov (0.22.0)
|
161
198
|
docile (~> 1.1)
|
162
|
-
|
163
|
-
|
164
|
-
simplecov-html (0.
|
165
|
-
simplecov-lcov (0.
|
166
|
-
|
167
|
-
sqlite3 (1.
|
168
|
-
thor (
|
199
|
+
simplecov-html (~> 0.11)
|
200
|
+
simplecov_json_formatter (~> 0.1)
|
201
|
+
simplecov-html (0.12.3)
|
202
|
+
simplecov-lcov (0.8.0)
|
203
|
+
simplecov_json_formatter (0.1.4)
|
204
|
+
sqlite3 (1.6.8-x86_64-darwin)
|
205
|
+
thor (1.3.0)
|
169
206
|
thread_safe (0.3.6)
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
207
|
+
timers (4.3.5)
|
208
|
+
traces (0.11.1)
|
209
|
+
tzinfo (2.0.6)
|
210
|
+
concurrent-ruby (~> 1.0)
|
211
|
+
undercover (0.4.6)
|
212
|
+
imagen (>= 0.1.8)
|
213
|
+
rainbow (>= 2.1, < 4.0)
|
214
|
+
rugged (>= 0.27, < 1.7)
|
176
215
|
unicode-display_width (1.4.1)
|
177
|
-
with_model (2.1.
|
178
|
-
activerecord (>=
|
216
|
+
with_model (2.1.7)
|
217
|
+
activerecord (>= 6.0)
|
218
|
+
zeitwerk (2.6.12)
|
179
219
|
|
180
220
|
PLATFORMS
|
181
|
-
|
221
|
+
x86_64-darwin-21
|
182
222
|
|
183
223
|
DEPENDENCIES
|
184
224
|
activerecord
|
@@ -189,7 +229,7 @@ DEPENDENCIES
|
|
189
229
|
github_changelog_generator
|
190
230
|
pry
|
191
231
|
pry-nav
|
192
|
-
rake (~>
|
232
|
+
rake (~> 13.0)
|
193
233
|
rspec (~> 3.0)
|
194
234
|
rspec-rails (~> 3.5)
|
195
235
|
rubocop (= 0.61.0)
|
@@ -199,7 +239,7 @@ DEPENDENCIES
|
|
199
239
|
sqlite3
|
200
240
|
thread_safe
|
201
241
|
undercover
|
202
|
-
with_model
|
242
|
+
with_model
|
203
243
|
|
204
244
|
BUNDLED WITH
|
205
|
-
2.
|
245
|
+
2.4.10
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.require_paths = ["lib"]
|
35
35
|
|
36
36
|
spec.add_dependency "active_model_serializers", ">= 0.10.0.rc4"
|
37
|
-
spec.add_dependency "batch-loader"
|
37
|
+
spec.add_dependency "batch-loader"
|
38
38
|
|
39
39
|
spec.add_development_dependency "activerecord"
|
40
40
|
# A Ruby library for testing against different versions of dependencies
|
@@ -44,7 +44,7 @@ Gem::Specification.new do |spec|
|
|
44
44
|
spec.add_development_dependency "github_changelog_generator"
|
45
45
|
spec.add_development_dependency "pry"
|
46
46
|
spec.add_development_dependency "pry-nav"
|
47
|
-
spec.add_development_dependency "rake", "~>
|
47
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
48
48
|
spec.add_development_dependency "rspec", "~> 3.0"
|
49
49
|
spec.add_development_dependency "rspec-rails", "~> 3.5"
|
50
50
|
spec.add_development_dependency "rubocop", "= 0.61.0"
|
@@ -55,7 +55,7 @@ Gem::Specification.new do |spec|
|
|
55
55
|
# Detect untested code blocks in recent changes
|
56
56
|
spec.add_development_dependency "undercover"
|
57
57
|
# Dynamically build an Active Record model (with table) within a test context
|
58
|
-
spec.add_development_dependency "with_model"
|
58
|
+
spec.add_development_dependency "with_model"
|
59
59
|
|
60
60
|
# Implicit dependency of AMS - used to be a part of Rails
|
61
61
|
spec.add_development_dependency "thread_safe"
|
@@ -52,7 +52,10 @@ module AmsLazyRelationships::Core
|
|
52
52
|
private
|
53
53
|
|
54
54
|
def lazy_dig_relationship!(relation_name, relationships)
|
55
|
-
relationships[:data].map! do |
|
55
|
+
relationships[:data].map! do |data|
|
56
|
+
serializer = data[:serializer]
|
57
|
+
object = data[:object]
|
58
|
+
|
56
59
|
next_objects = lazy_dig_next_objects!(relation_name, serializer, object)
|
57
60
|
next unless next_objects
|
58
61
|
|
@@ -22,9 +22,7 @@ module AmsLazyRelationships
|
|
22
22
|
attr_reader :model_class_name, :association_name
|
23
23
|
|
24
24
|
def load_data(records, loader)
|
25
|
-
|
26
|
-
records_to_preload(records), association_name
|
27
|
-
)
|
25
|
+
preload(records)
|
28
26
|
|
29
27
|
data = []
|
30
28
|
records.each do |r|
|
@@ -40,6 +38,19 @@ module AmsLazyRelationships
|
|
40
38
|
@batch_key ||= "#{model_class_name}/#{association_name}"
|
41
39
|
end
|
42
40
|
|
41
|
+
def preload(records)
|
42
|
+
if ::ActiveRecord::VERSION::MAJOR >= 7
|
43
|
+
::ActiveRecord::Associations::Preloader.new(
|
44
|
+
records: records_to_preload(records),
|
45
|
+
associations: association_name
|
46
|
+
).call
|
47
|
+
else
|
48
|
+
::ActiveRecord::Associations::Preloader.new.preload(
|
49
|
+
records_to_preload(records), association_name
|
50
|
+
)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
43
54
|
def records_to_preload(records)
|
44
55
|
# It may happen that same record comes here twice (e.g. wrapped
|
45
56
|
# in a decorator and non-wrapped). In this case Associations::Preloader
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ams_lazy_relationships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Bajena
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_model_serializers
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: batch-loader
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: activerecord
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '13.0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '13.0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rspec
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -252,16 +252,16 @@ dependencies:
|
|
252
252
|
name: with_model
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
|
-
- - "
|
255
|
+
- - ">="
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version: '
|
257
|
+
version: '0'
|
258
258
|
type: :development
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
|
-
- - "
|
262
|
+
- - ">="
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version: '
|
264
|
+
version: '0'
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: thread_safe
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
@@ -290,8 +290,8 @@ dependencies:
|
|
290
290
|
- - "~>"
|
291
291
|
- !ruby/object:Gem::Version
|
292
292
|
version: '0.1'
|
293
|
-
description:
|
294
|
-
email:
|
293
|
+
description:
|
294
|
+
email:
|
295
295
|
executables: []
|
296
296
|
extensions: []
|
297
297
|
extra_rdoc_files: []
|
@@ -320,6 +320,10 @@ files:
|
|
320
320
|
- gemfiles/ams_0.10.2.gemfile
|
321
321
|
- gemfiles/ams_0.10.3.gemfile
|
322
322
|
- gemfiles/ams_0.10.8.gemfile
|
323
|
+
- gemfiles/batch_loader_1.gemfile
|
324
|
+
- gemfiles/batch_loader_2.gemfile
|
325
|
+
- gemfiles/rails_6.gemfile
|
326
|
+
- gemfiles/rails_7.gemfile
|
323
327
|
- lib/ams_lazy_relationships.rb
|
324
328
|
- lib/ams_lazy_relationships/core.rb
|
325
329
|
- lib/ams_lazy_relationships/core/evaluation.rb
|
@@ -343,7 +347,7 @@ metadata:
|
|
343
347
|
homepage_uri: https://github.com/Bajena/ams_lazy_relationships
|
344
348
|
source_code_uri: https://github.com/Bajena/ams_lazy_relationships
|
345
349
|
changelog_uri: https://github.com/Bajena/ams_lazy_relationships/blob/master/CHANGELOG.md
|
346
|
-
post_install_message:
|
350
|
+
post_install_message:
|
347
351
|
rdoc_options: []
|
348
352
|
require_paths:
|
349
353
|
- lib
|
@@ -358,8 +362,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
358
362
|
- !ruby/object:Gem::Version
|
359
363
|
version: '0'
|
360
364
|
requirements: []
|
361
|
-
rubygems_version: 3.
|
362
|
-
signing_key:
|
365
|
+
rubygems_version: 3.4.10
|
366
|
+
signing_key:
|
363
367
|
specification_version: 4
|
364
368
|
summary: ActiveModel Serializers addon for eliminating N+1 queries problem from the
|
365
369
|
serializers.
|