instance.reload() ignores 'include' option
See original GitHub issueFrom the docs: “Options that are passed on to Model.find”
But the following does not work (see gist):
https://gist.github.com/matmar10/d460f0fdfa6071dbb2c1
// this works
User.findOne({
include: [{ as: 'roles', model: UserRole }],
where: { id: 1 }
}).then(function (user) {
// has `roles` property OK
console.log(user);
});
// this does not work
User.findOne({
where: { id: 1 }
}).then(function (user) {
user.reload({
include: [{ as: 'roles', model: UserRole }]
}).then(function (user) {
// does NOT have `roles` property
console.log(user);
});
});
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:17 (5 by maintainers)
Top Results From Across the Web
How do I unload (reload) a Python module? - Stack Overflow
You can reload a module when it has already been imported by using importlib.reload() : from importlib import reload # Python 3.4+ import ......
Read more >Health checks for Auto Scaling instances - AWS Documentation
Learn how Amazon EC2 Auto Scaling monitors and responds to health check failures and mitigates against the possibility of false positives.
Read more >API - ESBuild
Working directory. #Simple options. #Alias. Supported by: Build. This feature lets you substitute one package for another when bundling. The example ...
Read more >Loading Data - Snowflake Documentation
The COPY INTO <table> command includes a FILES parameter to load files by specific name. Tip. Of the three options for identifying/specifying data...
Read more >hugo server
It will then live reload any open browser pages and push the latest ... --help help for server --ignoreCache ignores the cache directory ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just tested this and reload with include works fine. I believe this ticket can be closed.
Shouldn’t it try to honor the include option passed to reload, if it exists? Something like: