motion-json-api 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: f165e4c2b8c5d642a6b0acc10f186f0d76dd3bd0
4
- data.tar.gz: c35d95370ba1a065755a02cbf9faff7d15af1fc9
3
+ metadata.gz: 70ffd1c94a4279deeb66c42235e0439474526a58
4
+ data.tar.gz: b6733acb00176884009cf37fdcaa48e8ea1c4a0b
5
5
  SHA512:
6
- metadata.gz: d5ed4eebeed4e35c8cfdfb6d50d7ac78540c26345ea215cc035275209066e7b338ea8a6bd0d2246d3f27d58a5e957c0ed432c707255ec72d35a64da127a20c65
7
- data.tar.gz: 84f164d7eb46c31fca01093f7475892b1a7c221b2a1f15b426ee9adfccae714d350b374eee60cec8a941a2e813b9bf923d255b17a64698f2592385ae827cd479
6
+ metadata.gz: 46f4d8fdf83d71a5b857f21939af81d48e9a9b6787535fca44c49a95400b3c6e44abc559b1e344e64acdac5d8619e7efa94d7e6caaa7abcea54a61e5b4bd9bcb
7
+ data.tar.gz: d3107e79a51619746d7b4fb9969eadf56ba8079791552e4592bb1b90c70b08fe00f5b89eb42484344c8075ec7a2e6b202aa84d15483a15f7555b15fdd07ef2ea
@@ -48,9 +48,8 @@ module MotionJsonApi
48
48
  key = options.fetch(:key, relation)
49
49
  define_method(key) do
50
50
  relationship = self.relationships.fetch(relation.to_s, {})
51
-
52
51
  data = relationship.fetch("data", nil)
53
- if data
52
+ if data && !data.empty?
54
53
  object = _find_in_included(data["id"], data["type"])
55
54
  if object
56
55
  payload = {"data" => object, "links" => relationship.fetch("links", {})}
@@ -1,3 +1,3 @@
1
1
  module MotionJsonApi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-json-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joffrey Jaffeux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-08 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler