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: 76109d783e52c411bd1ed7583bd94f50478f7605
4
- data.tar.gz: f3d5581fbbda759b055219c454d8a2060dc879b0
3
+ metadata.gz: a2bbb04bc6e7c4ee7280deac94c624390b505219
4
+ data.tar.gz: 4b94307e06cb63e21b52f6c4329b233743eeddb9
5
5
  SHA512:
6
- metadata.gz: fed2ef49d65ba39ba4255a599886e93255afb03d654efa45ca820f561399fff83eed54cc0e536da49d0335f7a6b7d4b4832452bdaed1ab76e511442cec769e0d
7
- data.tar.gz: 0f95a5e83ea0a23b570dcf84b44f552b8d1536826e3331815ebec4d28da307fb2c32331527ab7451ae5fcc0675f9f5c2511c4c65c438d3668c1db64036e35741
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
- valid = true
49
- return false unless valid_object?(model)
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.each do |r|
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
- valid = all_valid?(r, deserialized_params[:relationships] || {})
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
- valid = all_valid?(related_object, deserialized_params[:relationships] || {})
66
+ checks << all_valid?(related_object, payload[:relationships] || {})
65
67
  end
66
68
  end
67
69
  end
68
- valid
70
+ checks.all? { |c| c == true }
69
71
  end
70
72
  end
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.11.31"
2
+ VERSION = "0.11.32"
3
3
  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.31
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-09-10 00:00:00.000000000 Z
12
+ date: 2018-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-serializable