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

Polymorphic relationships via mixin break tests #240

Closed
Asherlc opened this issue Sep 20, 2016 · 1 comment
Closed

Polymorphic relationships via mixin break tests #240

Asherlc opened this issue Sep 20, 2016 · 1 comment

Comments

@Asherlc
Copy link

Asherlc commented Sep 20, 2016

It looks like when you have a polymorphic Ember Data relationship that uses a mixin as the common ancestor, moduleForModel breaks, as it tries to resolve the mixin name to a model. needsing it doesn't appease it, for obvious reasons.

See the example here:
https://ember-twiddle.com/5c95f54a6aff631595c0323aca06eea6?openFiles=controllers.application.js%2C

@pangratz
Copy link
Member

If the relationship would be a model, you would need to needs: ['model:other-model']. If it's a polymorphic relationship using mixins, you need to needs that mixin via, in your case, needs: ['mixin:child']. See this updated twiddle.

@Asherlc Asherlc closed this as completed Sep 22, 2016
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

No branches or pull requests

2 participants