restful-jsonapi 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restful/jsonapi/serializable_errors.rb +5 -4
- data/lib/restful/jsonapi/version.rb +1 -1
- data/restful-jsonapi-0.0.8.gem +0 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3d6d2a1c2d7dc8e74603ec864e2d8286b24bdbb
|
4
|
+
data.tar.gz: 61319a7798e649dae4cf91fa6803ccfa786113fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19f5f3e953ce50450ae691e9742ad7caf26a3eec2dffcf4388dc3986e88c466359f94e1516fea70ffebc83c8db504f83d69ecd689977aec53f9ead6d385d594b
|
7
|
+
data.tar.gz: fd69d2b95cd4c6d2fcb30eace925d6ce97dd8415e202d2eae2701d1a5b035235494acc32ef943d2e4d4dbc373dcc5cb9f2218e90970efae261252dcba04ef410
|
@@ -4,13 +4,14 @@ module Restful
|
|
4
4
|
extend ActiveSupport::Concern
|
5
5
|
|
6
6
|
def serializable_errors(object)
|
7
|
-
json = {}
|
8
|
-
|
9
7
|
errors = object.errors
|
8
|
+
prefix = object.class.to_s.demodulize.underscore
|
9
|
+
|
10
|
+
json = {}
|
10
11
|
|
11
|
-
new_hash = errors.to_hash
|
12
|
+
new_hash = errors.to_hash.map do |k, v|
|
12
13
|
v.map do |msg|
|
13
|
-
{ id: k, title: msg }
|
14
|
+
{ id: "#{prefix}.#{k}", title: msg }
|
14
15
|
end
|
15
16
|
end.flatten
|
16
17
|
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restful-jsonapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Wentz
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/restful/jsonapi/restify_param.rb
|
57
57
|
- lib/restful/jsonapi/serializable_errors.rb
|
58
58
|
- lib/restful/jsonapi/version.rb
|
59
|
+
- restful-jsonapi-0.0.8.gem
|
59
60
|
- restful-jsonapi.gemspec
|
60
61
|
homepage: https://github.com/Netflix/restful-jsonapi
|
61
62
|
licenses:
|