Add error details to response

pull/2081/head
Hagen Schink 10 years ago
parent 856d093814
commit 8f81ea25e7
  1. 2
      lib/api/errors/unwritable_property.rb
  2. 1
      lib/api/v3/errors/error_representer.rb

@ -41,6 +41,8 @@ module API
invalid_attributes.each do |attribute|
@errors << UnwritableProperty.new(attribute)
end
else
@details = { attribute: attributes[0] }
end
end
end

@ -42,6 +42,7 @@ module API
property :_type, exec_context: :decorator
property :error_identifier, exec_context: :decorator, render_nil: true
property :message, getter: -> (*) { message }, render_nil: true
property :details, embedded: true
collection :errors,
embedded: true,

Loading…
Cancel
Save