jsonapi.rb 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jsonapi/active_model_error_serializer.rb +4 -2
- data/lib/jsonapi/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33681c6b51c54e27169bfef6b0d9185e1fb80b95
|
4
|
+
data.tar.gz: 4fabb406e5d206e9c42896c6e58a5e77372a68a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae9a1760b380ef3ff3ebb6b050cdb29b7e59e1032ad21d61f26bb97a357b873590f9fa12fca544cd7074ee04fab2d6ea40b86d7eccaa5832bd6ad334eacbe212
|
7
|
+
data.tar.gz: d55f34067318a8fb16a841cf742b5e9180c306ca54e48f7f69461db45ad1d0df621f93c41d36727d644e38262973e420aad2253a132dee22295dd4a43ac0c4b0
|
data/Gemfile.lock
CHANGED
@@ -37,10 +37,12 @@ module JSONAPI
|
|
37
37
|
attribute :source do |object, params|
|
38
38
|
error_key, _ = object
|
39
39
|
model_serializer = params[:model_serializer]
|
40
|
+
attrs = (model_serializer.attributes_to_serialize || {}).keys
|
41
|
+
rels = (model_serializer.relationships_to_serialize || {}).keys
|
40
42
|
|
41
|
-
if
|
43
|
+
if attrs.include?(error_key)
|
42
44
|
{ pointer: "/data/attributes/#{error_key}" }
|
43
|
-
elsif
|
45
|
+
elsif rels.include?(error_key)
|
44
46
|
{ pointer: "/data/relationships/#{error_key}" }
|
45
47
|
else
|
46
48
|
{ pointer: '' }
|
data/lib/jsonapi/version.rb
CHANGED