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
model is not associated to theOtherModel when trying eager loading #3273
Comments
If you are using an alias on the association you need to use it on the include aswell. |
@mickhansen works! Sorry for my impatient : ) I finally find this tip in the Eager Loading section:
|
When using eager loading with the |
- It must contain the alias defined in the model as per sequelize issue: sequelize/sequelize#3273 - Added 'find permissions' test. At the moment returning permissions as sequelize instances. - Fixed beforeEach to do sync in correct order, otherwise drop tables cannot be done due to existent rows in tables with foreign keys.
@mickhansen Wow thanks. These aliases do not work as i would expect them to :/ |
Hmm... I just updated to Sequelize 4.3.2. I have many-to-many relationships that worked perfectly before the update. I don't use aliases anywhere in the code, and still it is giving me the error: "Unhandled rejection SequelizeEagerLoadingError: modelone is not associated to modeltwo!". Is there anything else than aliases that I should check to resolve this? |
I am in this same mess.
then I have Address.js model
and UserAddress.js model
I have a function that is supposed to fetch user and included all addresses for that user. Unfortunately, this is not working.
I get this error
This is part of my dependencies
Please I need help urgently, thanks |
@smithaitufe I don't know if this helps, but I solved my issue here: |
Father:
Child
And my test case:
And keep getting this error:
Frustrated : ( , did I miss something ? ( currently using sequelizeJS 2.0.1 with MySQL )
The text was updated successfully, but these errors were encountered: