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
{{ message }}
Repository navigation
Association mixins attempt to override attributes on model, causing error #9952
When I have a model that defines a property whose name matches one of the mixin names that would get generated when I add an association to the model, the model definition and association blows up.
I don't want it to blow up and instead want to skip the hasLocations() method mixin definition because it conflicts with the hasLocations prop
What is actually happening?
I get the following error
TypeError: Cannot read property 'hasLocations' of undefined
at Model.get (<project-root>/node_modules/sequelize/lib/model.js:3305:29)
at Model.funcs.(anonymous function) (<project-root>/node_modules/sequelize/lib/model.js:1022:25)
at Object.mixinMethods (<project-root>/node_modules/sequelize/lib/associations/helpers.js:58:13)
at HasMany.mixin (<project-root>/node_modules/sequelize/lib/associations/has-many.js:155:13)
at Function.hasMany (<project-root>/node_modules/sequelize/lib/associations/mixin.js:34:17)
Sequelize version: 5.0.0-beta.12 Tested with latest release: Yes (If yes, specify that version)
Activity
fix(model): check attribute overrides when defining assoc mixins (seq…
fix(model): check attribute overrides when defining assoc mixins (seq…
fix(model): check for own property when overriding association mixins (…