graphiti 1.2.38 → 1.2.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/request_validators/validator.rb +10 -5
- 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: 6d2917a607d95ef6d4701b8960ed183fd39923662b034d74fda9f8080f65d534
|
4
|
+
data.tar.gz: 7fc8ec33363e0112c541d05c676c7315b1934876f15875ac0b153bf2fc6cebdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f9867cbf49483cb09a887db26af222e2d74962c07aaf6ece7552a73cf74b625ca49e19ed730c1f383f7706ae10546551d54792b2b09832709aa14829ddd8180
|
7
|
+
data.tar.gz: 746d7900a12437a7a610dc8d4e8737ada319867578349898cc95067d7295c1b04b659dec00e33aec0a9977c33ecafd0a58f9f07da61ec04def6ad8131656351f
|
@@ -25,7 +25,7 @@ module Graphiti
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
typecast_attributes(resource, deserialized_payload.attributes, deserialized_payload.meta[:payload_path])
|
28
|
+
typecast_attributes(resource, deserialized_payload.attributes, @action, deserialized_payload.meta[:payload_path])
|
29
29
|
process_relationships(resource, deserialized_payload.relationships, deserialized_payload.meta[:payload_path])
|
30
30
|
else
|
31
31
|
errors.add(:"data.type", :missing)
|
@@ -65,15 +65,20 @@ module Graphiti
|
|
65
65
|
next
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
|
68
|
+
resource = x[:resource]
|
69
|
+
attributes = x[:attributes]
|
70
|
+
relationships = x[:relationships]
|
71
|
+
payload_path = x[:meta][:payload_path]
|
72
|
+
action = x[:meta][:method]
|
73
|
+
typecast_attributes(resource, attributes, action, payload_path)
|
74
|
+
process_relationships(resource, relationships, payload_path)
|
70
75
|
end
|
71
76
|
end
|
72
77
|
|
73
|
-
def typecast_attributes(resource, attributes, payload_path)
|
78
|
+
def typecast_attributes(resource, attributes, action, payload_path)
|
74
79
|
attributes.each_pair do |key, value|
|
75
80
|
# Only validate id if create action, otherwise it's only used for lookup
|
76
|
-
next if
|
81
|
+
next if action != :create &&
|
77
82
|
key == :id &&
|
78
83
|
resource.class.config[:attributes][:id][:writable] == false
|
79
84
|
|
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.2.
|
4
|
+
version: 1.2.39
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|