graphiti 1.0.beta.10 → 1.0.beta.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphiti/debugger.rb +2 -3
- data/lib/graphiti/query.rb +2 -0
- data/lib/graphiti/util/validation_response.rb +8 -6
- data/lib/graphiti/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3817c5eb61324763c5381d8c08028a084582990d
|
4
|
+
data.tar.gz: 1159861050a883d131a3900b4b214ef0ed52eb27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ff6ca0dd9db8aac5b84ca500264131a28845b8b01daa3789c6fd0574ff47d26412784173ba553fa3d5d506e2e7082999a4c61a0c99bd3130cecccbf00a0f392
|
7
|
+
data.tar.gz: a93ea8aff07090144b646fbdd173521fbaff553d894374a0e2a14cebb9cdd833a4a288223a7271559c37833ff3bc5df31734b94dcbfbd344d840b6e3a1354ed7
|
data/lib/graphiti/debugger.rb
CHANGED
@@ -59,12 +59,11 @@ module Graphiti
|
|
59
59
|
sideload = payload[:sideload]
|
60
60
|
results = results(payload[:results])
|
61
61
|
add_chunk(payload[:resource], payload[:parent]) do |logs, json|
|
62
|
-
#logs << [" \\_ #{sideload.parent_resource_class} > \"#{sideload.name}\":", :yellow, true]
|
63
62
|
logs << [" \\_ #{sideload.name}", :yellow, true]
|
64
63
|
json[:name] = sideload.name
|
65
64
|
query = "#{payload[:resource].class.name}.all(#{params.inspect})"
|
66
|
-
unless
|
67
|
-
query = "#{
|
65
|
+
unless payload[:resource]
|
66
|
+
query = "#{sideload.resource.class.name}: Manual sideload via .scope"
|
68
67
|
end
|
69
68
|
logs << [" #{query}", :cyan, true]
|
70
69
|
json[:query] = query
|
data/lib/graphiti/query.rb
CHANGED
@@ -53,26 +53,28 @@ class Graphiti::Util::ValidationResponse
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def all_valid?(model, deserialized_params)
|
56
|
-
|
57
|
-
|
56
|
+
checks = []
|
57
|
+
checks << valid_object?(model)
|
58
58
|
deserialized_params.each_pair do |name, payload|
|
59
59
|
if payload.is_a?(Array)
|
60
60
|
related_objects = model.send(name)
|
61
|
-
related_objects.
|
61
|
+
related_objects.each_with_index do |r, index|
|
62
62
|
valid = valid_object?(r)
|
63
|
+
checks << valid
|
63
64
|
|
64
65
|
if valid
|
65
|
-
|
66
|
+
checks << all_valid?(r, payload[index][:relationships] || {})
|
66
67
|
end
|
67
68
|
end
|
68
69
|
else
|
69
70
|
related_object = model.send(name)
|
70
71
|
valid = valid_object?(related_object)
|
72
|
+
checks << valid
|
71
73
|
if valid
|
72
|
-
|
74
|
+
checks << all_valid?(related_object, payload[:relationships] || {})
|
73
75
|
end
|
74
76
|
end
|
75
77
|
end
|
76
|
-
|
78
|
+
checks.all? { |c| c == true }
|
77
79
|
end
|
78
80
|
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.beta.
|
4
|
+
version: 1.0.beta.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jsonapi-serializable
|