lhs 22.1.0 → 22.1.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhs/concerns/record/request.rb +11 -19
- data/lib/lhs/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16eb1258e85aa5df4d0e727f4c0d76d2d9dfb7c90431d0bfe3fb6d91fa017c01
|
4
|
+
data.tar.gz: 9ba046b707ca2ada6faec0723b11567beab63a071bebb246314a00329ba56244
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce04f36ec3df38081737a718f81ff3714e41aadb429392bc881cd206d602686aab0d80d47ebe931a8d900b18535c01fde05c5e788592df12f635c7e26ff81efa
|
7
|
+
data.tar.gz: 1962f862a8699cf5f9c39f2076092eabe8d76e759f2f0b458b71db3713a65092a846cbf4ffbdabfbe745d57c33449259df987a61addaba1315828fc1bd4a310d
|
@@ -187,7 +187,7 @@ class LHS::Record
|
|
187
187
|
options = extend_with_reference(options, reference)
|
188
188
|
addition = load_include(options, data, sub_includes, reference)
|
189
189
|
extend_raw_data!(data, addition, included)
|
190
|
-
expand_addition!(data, included, options)
|
190
|
+
expand_addition!(data, included, options) unless expanded_data?(addition)
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
@@ -208,25 +208,21 @@ class LHS::Record
|
|
208
208
|
options = extend_with_reference(options, reference.except(:url))
|
209
209
|
record = record_for_options(options) || self
|
210
210
|
options = convert_options_to_endpoints(options) if record_for_options(options)
|
211
|
-
expanded_data =
|
212
|
-
record.request(options)
|
213
|
-
rescue LHC::NotFound
|
214
|
-
LHS::Data.new({}, data, record)
|
215
|
-
end
|
211
|
+
expanded_data = record.request(options)
|
216
212
|
extend_raw_data!(data, expanded_data, included)
|
217
213
|
end
|
218
214
|
|
219
|
-
def
|
215
|
+
def expanded_data?(addition)
|
220
216
|
return false if addition.blank?
|
221
217
|
if addition.item?
|
222
|
-
(addition._raw.keys - [:href]).
|
218
|
+
(addition._raw.keys - [:href]).any?
|
223
219
|
elsif addition.collection?
|
224
220
|
addition.all? do |item|
|
225
221
|
next if item.blank?
|
226
222
|
if item._raw.is_a?(Hash)
|
227
|
-
(item._raw.keys - [:href]).
|
223
|
+
(item._raw.keys - [:href]).any?
|
228
224
|
elsif item._raw.is_a?(Array)
|
229
|
-
item.any? { |item| (item._raw.keys - [:href]).
|
225
|
+
item.any? { |item| (item._raw.keys - [:href]).any? }
|
230
226
|
end
|
231
227
|
end
|
232
228
|
end
|
@@ -351,15 +347,11 @@ class LHS::Record
|
|
351
347
|
def load_include(options, data, sub_includes, references)
|
352
348
|
record = record_for_options(options) || self
|
353
349
|
options = convert_options_to_endpoints(options) if record_for_options(options)
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
load_include_simple!(options, record)
|
360
|
-
end
|
361
|
-
rescue LHC::NotFound
|
362
|
-
LHS::Data.new({}, data, record)
|
350
|
+
prepare_options_for_include_request!(options, sub_includes, references)
|
351
|
+
if references && references[:all] # include all linked resources
|
352
|
+
load_include_all!(options, record, sub_includes, references)
|
353
|
+
else # simply request first page/batch
|
354
|
+
load_include_simple!(options, record)
|
363
355
|
end
|
364
356
|
end
|
365
357
|
|
data/lib/lhs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 22.1.
|
4
|
+
version: 22.1.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- https://github.com/local-ch/lhs/graphs/contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -561,9 +561,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
561
561
|
version: 2.3.0
|
562
562
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
563
563
|
requirements:
|
564
|
-
- - "
|
564
|
+
- - ">"
|
565
565
|
- !ruby/object:Gem::Version
|
566
|
-
version:
|
566
|
+
version: 1.3.1
|
567
567
|
requirements:
|
568
568
|
- Ruby >= 2.3.0
|
569
569
|
rubygems_version: 3.0.6
|