sequelize/express-example

Association via classMethods doesn't work

bwoodlt opened this issue · 2 comments

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!

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