The following was worked fine before the update.
Getting the following error:
Uncaught TypeError: Cannot read property 'eachAttribute' of undefined
I am reloading a model
this.modelFor('admin').get('ssoApplicationSubscriptions').reload();
When it starts executing the eachAttribute
loop I get the error. Interestingly the constructor is undefined at this point.
Here are the model definitions
// Organisation
export default DS.Model.extend({
name: attr('string')
});
// Institution Organisation
export default Organisation.extend({
ssoApplicationSubscriptions: hasMany('sso-application-subscription', { polymorphic: true })
});
I am using the JSONAPIAdapter/Serializer.
I was having the same issue with this one and it came down to me using the constructor to get the model name of the polymorphic model. in my case I have emails and emails belong to a promotion, which is polymorphic so it looked like this:
{{email.promotion.content.constructor.modelName}}
and what I did to change it was this:
I added promotion_type: DS.attr("string")
to my Email
Model
and change the template to use that attr: {{email.promotion_type}}