Skip to content

Commit

Permalink
Merge pull request #50 from jasonswett/include-full-error-messages
Browse files Browse the repository at this point in the history
Include resource.errors.full_messages in error response.
  • Loading branch information
lynndylanhurley committed Oct 28, 2014
2 parents 1ef08e8 + 7bfa49c commit 50a1559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def create
render json: {
status: 'error',
data: @resource,
errors: @resource.errors
errors: @resource.errors.to_hash.merge(full_messages: @resource.errors.full_messages)
}, status: 403
end
rescue ActiveRecord::RecordNotUnique
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ class DeviseTokenAuth::RegistrationsControllerTest < ActionDispatch::Integration
test "error should be returned in the response" do
assert @data['errors'].length
end

test "full_messages should be included in error hash" do
assert @data['errors']['full_messages'].length
end
end

describe "Existing users" do
Expand Down

0 comments on commit 50a1559

Please sign in to comment.