graphiti 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -3
- data/lib/graphiti/base.rb +2 -0
- data/lib/graphiti/deserializer.rb +4 -12
- data/lib/graphiti/version.rb +1 -1
- 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: 77a0b8b5d8df9c67801e64943896e8ab1641626c7819548839f07ec498242fb7
|
4
|
+
data.tar.gz: 33c1ee5fe14d815a9d1bb4bf2763d468d613a22ac7f8417a827ddb19623d2de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a75fed69be79eba1cc5b892c55a6b452683164666fb96597e119b36100b7de98dd2671615ea6bba208e75e084697b03ec1b35850a8cefe431c5dd2edfe6a9c93
|
7
|
+
data.tar.gz: 169cb3b32f2ce23767e4a158da84d5b0b307ed3ee6c834b059237b59ca6b711b727c4449a6ed7fa8055a33e561bca0a258a007753a2c65359fa47b11cc20abee
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
+
## 1.0.2
|
2
|
+
|
3
|
+
Fixes:
|
4
|
+
|
5
|
+
- [#125](https://github.com/graphiti-api/graphiti/pull/125) Fix destroy
|
6
|
+
with validation errors (@mihaimuntenas)
|
7
|
+
|
1
8
|
## 1.0.1
|
2
9
|
|
3
|
-
|
4
|
-
|
5
|
-
(@richmolj)
|
10
|
+
Fixes:
|
11
|
+
|
12
|
+
- [#127](https://github.com/graphiti-api/graphiti/pull/127) Avoid Rails eager loading edge case with polymorphic resources (@richmolj)
|
6
13
|
|
7
14
|
### master (unreleased)
|
8
15
|
|
data/lib/graphiti/base.rb
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
#
|
46
46
|
# { type: 'authors', method: :create, temp_id: 'abc123' }
|
47
47
|
class Graphiti::Deserializer
|
48
|
-
def initialize(payload)
|
48
|
+
def initialize(payload = {})
|
49
49
|
@payload = payload
|
50
50
|
@payload = @payload[:_jsonapi] if @payload.key?(:_jsonapi)
|
51
51
|
end
|
@@ -56,7 +56,7 @@ class Graphiti::Deserializer
|
|
56
56
|
|
57
57
|
# @return [Hash] the raw :data value of the payload
|
58
58
|
def data
|
59
|
-
@payload
|
59
|
+
@payload.fetch(:data, {})
|
60
60
|
end
|
61
61
|
|
62
62
|
# @return [String] the raw :id value of the payload
|
@@ -189,18 +189,10 @@ class Graphiti::Deserializer
|
|
189
189
|
end
|
190
190
|
|
191
191
|
def raw_attributes
|
192
|
-
|
193
|
-
data[:attributes] || {}
|
194
|
-
else
|
195
|
-
{}
|
196
|
-
end
|
192
|
+
data.fetch(:attributes, {})
|
197
193
|
end
|
198
194
|
|
199
195
|
def raw_relationships
|
200
|
-
|
201
|
-
data[:relationships] || {}
|
202
|
-
else
|
203
|
-
{}
|
204
|
-
end
|
196
|
+
data.fetch(:relationships, {})
|
205
197
|
end
|
206
198
|
end
|
data/lib/graphiti/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphiti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|