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

fix(uniq-includes-with-association): modify uniqIncludes #10580

Merged
merged 3 commits into from Mar 25, 2019
Merged

fix(uniq-includes-with-association): modify uniqIncludes #10580

merged 3 commits into from Mar 25, 2019

Conversation

u9r52sld
Copy link
Contributor

@u9r52sld u9r52sld commented Mar 20, 2019

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

fixing _uniqIncludes function with include.association.

See issue: #10123

}
},
{
association: 'building'
Copy link
Contributor

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}`;
})
Copy link
Contributor

@madmoizo madmoizo Mar 20, 2019

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

codecov bot commented Mar 23, 2019

Codecov Report

Merging #10580 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10580   +/-   ##
=======================================
  Coverage   96.18%   96.18%           
=======================================
  Files          92       92           
  Lines        9009     9009           
=======================================
  Hits         8665     8665           
  Misses        344      344
Impacted Files Coverage Δ
lib/model.js 96.67% <100%> (-0.01%) ⬇️
lib/utils/classToInvokable.js 100% <0%> (ø) ⬆️
lib/data-types.js 91.25% <0%> (ø) ⬆️
lib/dialects/abstract/query-generator.js 97.57% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b868c8...f76bdcb. Read the comment docs.

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work 👍

@sushantdhiman
Copy link
Contributor

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants