n1_loader 1.6.4 → 1.6.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/n1_loader/active_record/loader_collection.rb +4 -0
- data/lib/n1_loader/core/loader.rb +9 -11
- data/lib/n1_loader/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7d5587fbac0376006abf03b7beb385547b1c9206cdeea8461d9bf07b67e0df4
|
4
|
+
data.tar.gz: 6f94574d65b49c528a6af3e06d6d816ed78ef3cf3f6e14002249b816526cbb4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39d0370fee07be7e080adb22392633366da8cce0b74228c728b8647e9f7f859b4c995346bf0a8e9b477c355374b29f4f4690f089c6b6904822af3cfba88685af
|
7
|
+
data.tar.gz: 0245c5ba26df1d3f3508a22143ae5cb9d708c5460ef218ee2193b8cc537bf0ee6f6838357be50fe4d2d2d4c1db050e76a6176e98b3b7df4c64af4bf7b0e35e36
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [1.6.6] - 2023/07/30
|
2
|
+
|
3
|
+
- Fix naive check of required arguments. Thanks [Nazar Matus](https://github.com/FunkyloverOne) for the issue!
|
4
|
+
|
5
|
+
## [1.6.5] - 2023/07/30
|
6
|
+
|
7
|
+
- Fix nested preloading for ActiveRecord 7. Thanks [Igor Gonchar](https://github.com/gigorok) for the issue!
|
8
|
+
|
1
9
|
## [1.6.4] - 2023/07/30
|
2
10
|
|
3
11
|
- Add support of `n1_optimized` ending with `?` (question mark). Thanks [Ilya Kamenko](https://github.com/Galathius) for the suggestion!
|
@@ -62,22 +62,20 @@ module N1Loader
|
|
62
62
|
|
63
63
|
attr_reader :elements, :args
|
64
64
|
|
65
|
-
def check_missing_arguments! # rubocop:disable Metrics/AbcSize, Metrics/
|
65
|
+
def check_missing_arguments! # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
66
66
|
return unless (arguments = self.class.arguments)
|
67
67
|
|
68
|
-
|
69
|
-
|
68
|
+
required_arguments = arguments.reject { |argument| argument[:optional] }
|
69
|
+
.map { |argument| argument[:name] }
|
70
70
|
|
71
|
-
return if
|
71
|
+
return if required_arguments.all? { |argument| args.key?(argument) }
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
else
|
77
|
-
"#{min}..#{max}"
|
78
|
-
end
|
73
|
+
missing_arguments = required_arguments.reject { |argument| args.key?(argument) }
|
74
|
+
|
75
|
+
list = missing_arguments.map { |argument| ":#{argument}" }.join(", ")
|
79
76
|
|
80
|
-
raise MissingArgument,
|
77
|
+
raise MissingArgument,
|
78
|
+
"Loader requires [#{list}] arguments but they are missing"
|
81
79
|
end
|
82
80
|
|
83
81
|
def check_arguments!
|
data/lib/n1_loader/version.rb
CHANGED