You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Polymorphic relationships in Ember require either inheritance from a common parent or a mixin (with the name of the polymorphic relationship) to be applied. I'm trying to get the mixin solution working with an Ember Data model that uses native classes, however it doesn't seem that the mixin is being recognized. Inspecting the model shows that the mixin's properties were applied to the model, however.
The error I'm seeing is:
The 'lesson-reservation' type does not implement 'cancelable' and thus cannot be assigned to the 'cancelable' relationship in 'cancellation'. Make it a descendant of 'cancelable' or use a mixin of the same name.
The model is LessonReservation and the polymorphic association is cancelable. There is a mixin named cancelable.
The native class syntax doesn't work:
importDSfrom'ember-data';importCancelablefrom'frontend/mixins/cancelable';const{ Model }=DS;exportdefaultclassLessonReservationModelextendsModel.extend(Cancelable){}
However, the traditional syntax does work:
importDSfrom'ember-data';importCancelablefrom'frontend/mixins/cancelable';const{ Model }=DS;exportdefaultModel.extend(Cancelable,{})
It may be that I'm misattributing this issue to ember-decorators when it's a more core Ember issue but this seemed like a good place to start. Any guidance would be very appreciated.
The text was updated successfully, but these errors were encountered:
Polymorphic relationships in Ember require either inheritance from a common parent or a mixin (with the name of the polymorphic relationship) to be applied. I'm trying to get the mixin solution working with an Ember Data model that uses native classes, however it doesn't seem that the mixin is being recognized. Inspecting the model shows that the mixin's properties were applied to the model, however.
The error I'm seeing is:
The model is
LessonReservation
and the polymorphic association iscancelable
. There is a mixin namedcancelable
.The native class syntax doesn't work:
However, the traditional syntax does work:
It may be that I'm misattributing this issue to
ember-decorators
when it's a more core Ember issue but this seemed like a good place to start. Any guidance would be very appreciated.The text was updated successfully, but these errors were encountered: