ActiveModelAdapter camelizes keys for errors on 422 #3030
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fields are not currently camelized in the model's errors object e.g.
should be
There is already test for this behavior but because of the way
InvalidError
andEmber.inspect
are implemented the test passes when it shouldn't do.ActiveModelAdapter now passes the errors hash directly to
InvalidError
as is expected according to the docs. This assumes that the 422 provides JSON of the formas is standard in active model. If
errors
is not present in the JSON response, active model adapter will continue to behave as it did before.