lhs 21.2.3 → 21.2.4
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 +3 -1
- data/lib/lhs/version.rb +1 -1
- data/spec/record/includes_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d29a70798d8ce33c3fbd253465123d32fe2fd4a97e213a9f3cdce1350e45bd85
|
4
|
+
data.tar.gz: 50d2cd571874e523de51ed9652d4faec1406087e69940ee87f4941f5d416e9b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6fcfc2a0507d730e88045b0489d0f463bcff6235fe5a10cafdbd6c3560ae0e561479f3f2ae766ef7495be8c8e6d0efbce2636f468ae98a488d413ece8d6ca75
|
7
|
+
data.tar.gz: c7c48a2130f9cf32de2fdc657f0ba3b50b71e10b062a297797b383b0c5f2fd9cbdf1a9023237dcf1ca44c9f822ec3dd25ef3180a9915c166850477592c623b48
|
@@ -246,7 +246,9 @@ class LHS::Record
|
|
246
246
|
def skip_loading_includes?(data, included)
|
247
247
|
if data.collection?
|
248
248
|
data.to_a.none? { |item| item[included].present? }
|
249
|
-
elsif data
|
249
|
+
elsif data.dig(included).blank?
|
250
|
+
true
|
251
|
+
elsif data[included].item? && data[included][:href].blank?
|
250
252
|
true
|
251
253
|
else
|
252
254
|
!data._raw.key?(included)
|
data/lib/lhs/version.rb
CHANGED
@@ -705,4 +705,23 @@ describe LHS::Record do
|
|
705
705
|
}).not_to raise_exception
|
706
706
|
end
|
707
707
|
end
|
708
|
+
|
709
|
+
context 'include partially empty structures' do
|
710
|
+
before do
|
711
|
+
class Place < LHS::Record
|
712
|
+
endpoint 'https://places/{id}'
|
713
|
+
end
|
714
|
+
stub_request(:get, "https://places/1")
|
715
|
+
.to_return(body: {
|
716
|
+
id: '123',
|
717
|
+
customer: {}
|
718
|
+
}.to_json)
|
719
|
+
end
|
720
|
+
|
721
|
+
it 'skips includes when there is nothing and also does not raise an exception' do
|
722
|
+
expect(-> {
|
723
|
+
Place.includes(customer: :salesforce).find(1)
|
724
|
+
}).not_to raise_exception
|
725
|
+
end
|
726
|
+
end
|
708
727
|
end
|
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: 21.2.
|
4
|
+
version: 21.2.4
|
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-
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|