-
Notifications
You must be signed in to change notification settings - Fork 768
What does Model.associate() do in model/index.js ? #95
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
Comments
I have the same doubt. |
If I recall correctly, |
Hello everyone! @markjackson02 is correct. That was an extra function defined in the old example code; it existed to allow associations to be defined after all models were defined themselves. It is basically resolving the following problem: 'how can we associate models while keeping each model in a separate file?' Since we obviously need the models defined before associating them, this gets slightly nontrivial. The old example used the strategy of defining an I will update the new example soon with some associations, and will see if I work out another approach that might be less confusing. |
I will close this in favor of #106 |
I'm curious what does associate() do in model/index.js
I try to print associate for my model, and all of them are undefined.
So I'm curious why this example has these codes.
http://docs.sequelizejs.com/class/lib/model.js~Model.html
I try to find the definition from the doc, but I can't find it.
The text was updated successfully, but these errors were encountered: