Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove logic for camelCase-ing error keys in ActiveModelAdapter #3036

Merged
merged 2 commits into from
May 4, 2015
Merged

Remove logic for camelCase-ing error keys in ActiveModelAdapter #3036

merged 2 commits into from
May 4, 2015

Conversation

pangratz
Copy link
Member

@pangratz pangratz commented May 2, 2015

This addresses my comment made in #3030 (comment), where I stated that the made changes of camelCase-ing the error keys are a serializer concern:

Since c947e25 (introduced in #3030) the keys of the error object are camelCased in the adapter, which is actually a serializer concern. The JSONSerializer, from which the ActiveModelSerializer extends, does a normalization of the errors object in the extractErrors hook (see http://git.io/vJ0A6 & http://git.io/vJ0AS) and this hook gets called by the store when the adapter rejects (see http://git.io/vJ0AI), the camelCase can be removed from inside the adapter.

cc @fivetanley @bdvholmes

@fivetanley
Copy link
Member

Oh interesting. So it already camelCased, the tests were just wrong?

@ghost
Copy link

ghost commented May 3, 2015

Looks like it. I should have checked to see how extractErrors was being done here.

@pangratz
Copy link
Member Author

pangratz commented May 4, 2015

There were no tests for extractErrors, so @bdvholmes raised an important issue.

Since c947e25 the keys of the error
object are camelCased in the adapter, which is actually a serializer
concern. The JSONSerializer, from which the ActiveModelSerializer
extends, does a normalization of the errors object in the
`extractErrors` hook (see http://git.io/vJ0A6 & http://git.io/vJ0AS) and
this hook gets called by the store when the adapter rejects (see
http://git.io/vJ0AI), the camelCase can be removed from inside the
adapter.

A test for the correct normalization of the errors object is added to
the ActiveModelSerializer test suite.
@igorT
Copy link
Member

igorT commented May 4, 2015

Can you rebase please?

@pangratz
Copy link
Member Author

pangratz commented May 4, 2015

@igorT done

igorT added a commit that referenced this pull request May 4, 2015
…_model_errors

Remove logic for camelCase-ing error keys in ActiveModelAdapter
@igorT igorT merged commit 100ede1 into emberjs:master May 4, 2015
@igorT
Copy link
Member

igorT commented May 4, 2015

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants