lhs 21.2.1 → 21.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdee54df382d303ac6c2df71e4dfb3ce6816d098578fc1919262b2daa937763c
4
- data.tar.gz: '0340809599cfa8cb547c85dd031f8e767a644885637e77bcdc09ad011e2be617'
3
+ metadata.gz: 97ca91f932322b206403f8179975b5b9b82b3963518af2c914ea3dce57323ffc
4
+ data.tar.gz: 13849b65f18f9dce4748f11d693cb79ad3c4c467b3d790235de8d9b75ee410c5
5
5
  SHA512:
6
- metadata.gz: e01af57617fc98df8e61a053bb4b69a527701a29aa1cfd3b842ec1b08ca47e925702ffeedf31b019997a1693409fc00637da0dba4cc205b0cfafba0f1b2769c2
7
- data.tar.gz: 0f7418cee11af1966be59ad017f13469aaa94a96e4214045c05434312690b5d9fad08d4193b8705844e0d5f3411a1988498b50a966cf7324c167f9062493aa8a
6
+ metadata.gz: 1ab0338a4892d6ff23ea4698019d732733503d8f4c23eeff50beb7ceb6d41905d324c46d9e16e543514ec5c704c4392ce902f9c48ccf92aa4f01ef6b54833498
7
+ data.tar.gz: 401fbcaf2c25f3eca613a41bf1ca8815867c3df9a3e2ed18d3234da8b5d7c62e0499065f7d72f1d3bdde14ae1cf9dea7f017258647a9156c1c4a4d2f26b52ba7
@@ -176,7 +176,7 @@ class LHS::Record
176
176
  else
177
177
  handle_include(includes, data, nil, references[includes])
178
178
  end
179
- data.clear_cache! # as we just included new nested resources
179
+ data.clear_cache! if data.present? # as we just included new nested resources
180
180
  end
181
181
 
182
182
  def handle_include(included, data, sub_includes = nil, reference = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LHS
4
- VERSION = '21.2.1'
4
+ VERSION = '21.2.2'
5
5
  end
@@ -665,4 +665,22 @@ describe LHS::Record do
665
665
  expect(place.customer.salesforce.name).to eq 'Steve'
666
666
  end
667
667
  end
668
+
669
+ context 'include empty structures' do
670
+ before do
671
+ class Place < LHS::Record
672
+ endpoint 'https://places/{id}'
673
+ end
674
+ stub_request(:get, "https://places/1")
675
+ .to_return(body: {
676
+ id: '123'
677
+ }.to_json)
678
+ end
679
+
680
+ it 'skips includes when there is nothing and also does not raise an exception' do
681
+ expect(-> {
682
+ Place.includes(contracts: :product).find(1)
683
+ }).not_to raise_exception
684
+ end
685
+ end
668
686
  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.1
4
+ version: 21.2.2
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-03-20 00:00:00.000000000 Z
11
+ date: 2020-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel