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

Rest Serializer isPrimaryType should not use store.modelFor #5809

Closed
igorT opened this issue Jan 3, 2019 · 1 comment · Fixed by #6338
Closed

Rest Serializer isPrimaryType should not use store.modelFor #5809

igorT opened this issue Jan 3, 2019 · 1 comment · Fixed by #6338
Labels
🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166

Comments

@igorT
Copy link
Member

igorT commented Jan 3, 2019

Currently Rest Serializer implicitly does type normalization in store.isPrimaryType by calling store.modelFor. It shouldn't do that, it should normalize the type name itself

@runspired
Copy link
Contributor

TL;DR

isPrimaryType is used in one location to check if the result of store.modelFor(modelName) is equal to the ModelClass provided to the serializer as the primary ModelClass.

It would be better to check if normalizeModelName(modelName) === PrimaryModelClass.modelName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌲 Project Trim 🌲 PRs related to https://github.com/emberjs/data/issues/6166
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants