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
fix(uniq-includes-with-association): modify uniqIncludes #10580
fix(uniq-includes-with-association): modify uniqIncludes #10580
Conversation
} | ||
}, | ||
{ | ||
association: 'building' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you are passing association object, then uniqueInclude
can fail due to [object]
stringification
lib/model.js
Outdated
.groupBy(include => { | ||
const modelName = include.model ? include.model.name : include.association; | ||
return `${modelName}-${include.as}`; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
baseMerge
call _conformOptions
which mutates & normalize options.include
, just after _uniqInclude
is called which process the mutated options.include so at this moment, include.model is always defined and include.association is an instance of Association, or I missed something?
Codecov Report
@@ Coverage Diff @@
## master #10580 +/- ##
=======================================
Coverage 96.18% 96.18%
=======================================
Files 92 92
Lines 9009 9009
=======================================
Hits 8665 8665
Misses 344 344
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍
🎉 This PR is included in version 5.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
fixing
_uniqIncludes
function withinclude.association
.See issue: #10123