Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Association via classMethods doesn't work #56

Closed
bwoodlt opened this issue Jan 28, 2017 · 2 comments
Closed

Association via classMethods doesn't work #56

bwoodlt opened this issue Jan 28, 2017 · 2 comments

Comments

@bwoodlt
Copy link

bwoodlt commented Jan 28, 2017

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
Copy link
Contributor

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
Copy link
Author

bwoodlt commented Jan 31, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants