lhs 5.6.3 → 5.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34f496f9c15ded84fe153a6c53a61a726046e070
4
- data.tar.gz: 241dbdff9b5b737d9476816e07de14da3a32050a
3
+ metadata.gz: 1d5463ddb8aecb066995d59a8ef055bafd5b98ea
4
+ data.tar.gz: 13ff6360d6817f2615adde2c9a833abd3681e6d2
5
5
  SHA512:
6
- metadata.gz: 75566527a546a2891143b5c1c5caf21f78a0f85e87aab6568bbd8600c4ed799c022cb964436a885158384f1533cb20e1e79cc27c43948164e504e05ec95db519
7
- data.tar.gz: a380b71d2751fb01a0a5fe7ec1364b11409a6ad7dc4df102a3f969902d69ab5015057030ca62f0873b5d151449d6b873f3e1b6c4b504ef9a330696bb01224ff3
6
+ metadata.gz: 153293dfe1a6c8619a50e43d2f64d4616bd5fae5045aa95052b719d10bac03735aa0fe81f184792c74ef29ab31d83423b6b6b6662fadc8e8ea0c880cff57493f
7
+ data.tar.gz: 947150959ead6112b621ea868e8f4e3481195397e5cbc4277caacbefabaae31beb9558bb0f8bb6ef458eb7b2df1f1428e00740ee00d04d8b265ed456033953bb
@@ -70,7 +70,7 @@ class LHS::Record
70
70
  options =
71
71
  if data.collection?
72
72
  options_for_multiple(data, included)
73
- elsif data[included]._raw.is_a?(Array)
73
+ elsif data[included].collection?
74
74
  options_for_nested_items(data, included)
75
75
  else
76
76
  url_option_for(data, included)
@@ -1,3 +1,3 @@
1
1
  module LHS
2
- VERSION = "5.6.3"
2
+ VERSION = "5.6.4"
3
3
  end
@@ -292,4 +292,24 @@ describe LHS::Record do
292
292
  expect(place.relations[1].name).to eq 'ZeFrank'
293
293
  end
294
294
  end
295
+
296
+ context 'empty collections' do
297
+ it 'skips including empty collections' do
298
+ class Place < LHS::Record
299
+ endpoint ':datastore/place'
300
+ endpoint ':datastore/place/:id'
301
+ end
302
+
303
+ stub_request(:get, "#{datastore}/place/1")
304
+ .to_return(body: {
305
+ 'available_products' => {
306
+ "url" => "#{datastore}/place/1/products",
307
+ "items" => []
308
+ }
309
+ }.to_json)
310
+
311
+ place = Place.includes(:available_products).find(1)
312
+ expect(place.available_products.empty?).to eq true
313
+ end
314
+ end
295
315
  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: 5.6.3
4
+ version: 5.6.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: 2016-06-08 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lhc