Association via classMethods doesn't work
bwoodlt opened this issue · 2 comments
bwoodlt commented
Have been unable to associate models with each other.
classMethods: { associate: (models) => { Users.hasMany(models.customers, { foreignKey: 'user_id' }) } }
Any idea what I'm missing?
Thanks!
sushantdhiman commented
You need to call associate
method if you aren't using models/index
https://github.com/sequelize/express-example/blob/master/models/index.js#L27
bwoodlt commented
Many thanks!
Have been able to fix that issue.
….
Regards
Adekunle Adetayo
On 31 January 2017 at 08:40:26, Sushant (notifications@github.com<mailto:notifications@github.com>) wrote:
You need to call associate method if you aren't using models/index https://github.com/sequelize/express-example/blob/master/models/index.js#L27
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#56 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFL-lTD05oaxqLV7Qch2zbtjxEYiyJGjks5rXvNzgaJpZM4LweDI>.