dato 0.6.17 → 0.6.18

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: 71d1bdeb92e3e6d4504909f3d0aa3ea63e04a26adf8b1307861049f683957649
4
- data.tar.gz: 0402e5e79c5b0ac73b4f9156944ccb2f85474dc90b8baec5934937e0a5bdb72e
3
+ metadata.gz: 7011e6d97491b0d772ce29bf518411309948246a451495aad4889e09b57e379a
4
+ data.tar.gz: a90f2443479ff411ca350514bd17b4f0c78537de9d8c6acf51db0663d4d71529
5
5
  SHA512:
6
- metadata.gz: c38908321fb3f30eabf7af679919beea67c7dc9f8167b2f878c29815f28a9d35179bbfb7fbaafdc10820803418cfd9c23db8a3a7262bc48618e3cd24183a0ed7
7
- data.tar.gz: c1f5a022f86466cf8411cfd9799e1a459ebf4722bc3b95ef8d23c493f3a9c2c11b386fcb4262a27ef1ede53a5329fa2d251730bac6f17c2607444dd980c6f84b
6
+ metadata.gz: a6036fa4504f4ba21ef83186736d7788b8c6ecb1a3b2a2944f0a51635ef8d0aac4f6fe4ecbe9eb1f7dca9679dc4d7b4c2ded2cafa38cb4526deee60d7ca33d21
7
+ data.tar.gz: e605c4e7983a173a78a3432bfe4e3946cbb02666aea85759495ca5a65e40b3de1b85b2eccd556409f395d5a3adc030f16293f5545d7ad131dfe2ec096d808f3c
@@ -1,3 +1,7 @@
1
+ # 0.6.18
2
+
3
+ * Fixed regression where you could no longer access items' item type
4
+
1
5
  # 0.6.15
2
6
 
3
7
  * Handle `429 Too Many Requests` responses from API
@@ -7,11 +7,21 @@ module Dato
7
7
  end
8
8
 
9
9
  def relationships
10
- if !schema || !schema.properties['data'] || !schema.properties['data'].properties['relationships']
10
+ if !schema || !schema.properties['data']
11
11
  return {}
12
12
  end
13
13
 
14
- relationships = schema.properties['data'].properties['relationships'].properties
14
+ entity = if schema.properties['data'].type.first == 'array'
15
+ schema.properties['data'].items
16
+ else
17
+ schema.properties['data']
18
+ end
19
+
20
+ if !entity || !entity.properties['relationships'] || !entity.properties['relationships']
21
+ return {}
22
+ end
23
+
24
+ relationships = entity.properties['relationships'].properties
15
25
 
16
26
  relationships.each_with_object({}) do |(relationship, schema), acc|
17
27
  is_collection = schema.properties['data'].type.first == 'array'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dato
4
- VERSION = '0.6.17'
4
+ VERSION = '0.6.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.17
4
+ version: 0.6.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-25 00:00:00.000000000 Z
11
+ date: 2019-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler