restful-jsonapi 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 013af3832e22e46c18944a42cbde0eaf13ea23af
4
- data.tar.gz: be9766c381db40bc2d14bcf3e2eff03253831f77
3
+ metadata.gz: c3d6d2a1c2d7dc8e74603ec864e2d8286b24bdbb
4
+ data.tar.gz: 61319a7798e649dae4cf91fa6803ccfa786113fb
5
5
  SHA512:
6
- metadata.gz: d98c93fbd4669cba8d40649870496cad0a2884f30052047e94e51751649a46f4cccdad95161baaa83992507cb9b8d0759eb245219d119c4392bb662c74da6af9
7
- data.tar.gz: 8dcbb7636b662c427bdc7c07f3d43c178b47462c674b04171c42f9d3fcf38c17b1607c781a4b3e936d66719bf5bb0d92aeedc0a1b04de5305a65f6b73a1fae72
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(true).map do |k, v|
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
 
@@ -1,5 +1,5 @@
1
1
  module Restful
2
2
  module Jsonapi
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
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.8
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: