jsonapi_compliable 0.11.31 → 0.11.32
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2bbb04bc6e7c4ee7280deac94c624390b505219
|
4
|
+
data.tar.gz: 4b94307e06cb63e21b52f6c4329b233743eeddb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caf3cffdeffc4e5549296895db950e5ef7fa5b88959e165e1800927a1746e149cc9b869b906100c8e222123644751069a6a9b52509b066c09468f5e2e332a723
|
7
|
+
data.tar.gz: 3f5e5baad13444ad0d62b6bf4251060002153439ff0d77461950778fcd8ec20e8a14e0204ae6abae78ca07ef6de0771d97ddbc3d0c67ccffd3590ab1c7658923
|
@@ -45,26 +45,28 @@ class JsonapiCompliable::Util::ValidationResponse
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def all_valid?(model, deserialized_params)
|
48
|
-
|
49
|
-
|
48
|
+
checks = []
|
49
|
+
checks << valid_object?(model)
|
50
50
|
deserialized_params.each_pair do |name, payload|
|
51
51
|
if payload.is_a?(Array)
|
52
52
|
related_objects = model.send(name)
|
53
|
-
related_objects.
|
53
|
+
related_objects.each_with_index do |r, index|
|
54
54
|
valid = valid_object?(r)
|
55
|
+
checks << valid
|
55
56
|
|
56
57
|
if valid
|
57
|
-
|
58
|
+
checks << all_valid?(r, payload[index][:relationships] || {})
|
58
59
|
end
|
59
60
|
end
|
60
61
|
else
|
61
62
|
related_object = model.send(name)
|
62
63
|
valid = valid_object?(related_object)
|
64
|
+
checks << valid
|
63
65
|
if valid
|
64
|
-
|
66
|
+
checks << all_valid?(related_object, payload[:relationships] || {})
|
65
67
|
end
|
66
68
|
end
|
67
69
|
end
|
68
|
-
|
70
|
+
checks.all? { |c| c == true }
|
69
71
|
end
|
70
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_compliable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jsonapi-serializable
|