Skip to content

fix(model): check attributes specified for included through model - #12020

Merged
sushantdhiman merged 4 commits into
sequelize:v5from
aristov:fix/include-through-attributes
May 26, 2020
Merged

sushantdhiman merged 4 commits into
sequelize:v5from
aristov:fix/include-through-attributes

Conversation

@aristov

@aristov aristov commented Mar 21, 2020 •

Copy link
Copy Markdown
Contributor

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 update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Project.belongsToMany(User, { through : 'UserProject' })
User.belongsToMany(Project, { through : 'UserProject' })

User.findAll({
  include : [
    {
      model : Project,
      through : {
        attributes : [] // the option is fixed by this change
      }
    }
  ]
})

@aristov

aristov commented Mar 21, 2020

Copy link
Copy Markdown
Contributor Author

Let me know If anybody cares. Then I complete the PR by tests.

@codecov

codecov Bot commented Mar 21, 2020

Copy link
Copy Markdown

Codecov Report

Merging #12020 into v5 will decrease coverage by 15.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##               v5   #12020       +/-   ##
===========================================
- Coverage   89.58%   74.57%   -15.02%     
===========================================
  Files          92       85        -7     
  Lines        9091     8357      -734     
===========================================
- Hits         8144     6232     -1912     
- Misses        947     2125     +1178     
Impacted Files Coverage Δ
lib/model.js 95.40% <100.00%> (-1.01%) ⬇️
lib/dialects/sqlite/query-generator.js 2.91% <0.00%> (-93.69%) ⬇️
lib/dialects/postgres/query-generator.js 1.78% <0.00%> (-92.61%) ⬇️
lib/dialects/postgres/range.js 7.69% <0.00%> (-92.31%) ⬇️
lib/dialects/mysql/query-generator.js 5.62% <0.00%> (-92.21%) ⬇️
lib/dialects/postgres/query-interface.js 7.57% <0.00%> (-90.91%) ⬇️
lib/dialects/mariadb/query-generator.js 14.28% <0.00%> (-85.72%) ⬇️
lib/dialects/sqlite/query-interface.js 15.62% <0.00%> (-84.38%) ⬇️
lib/dialects/mysql/query.js 15.12% <0.00%> (-83.20%) ⬇️
lib/errors/database/exclusion-constraint-error.js 18.18% <0.00%> (-81.82%) ⬇️
... and 37 more

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 54d655d...bb3d4cb. Read the comment docs.

@sushantdhiman sushantdhiman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, Please add tests for this

@sushantdhiman sushantdhiman added the status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action label Apr 4, 2020
@haseebsaeed

haseebsaeed commented May 19, 2020 •

Copy link
Copy Markdown

Let me know If anybody cares. Then I complete the PR by tests.

@aristov me and my production code are waiting for this.

@aristov

aristov commented May 24, 2020

Copy link
Copy Markdown
Contributor Author

I have no idea how to fix MariaDB tests. I need help to solve this problem.

@sushantdhiman

Copy link
Copy Markdown
Contributor

This need a port to master branch first

@sushantdhiman

Copy link
Copy Markdown
Contributor

MariaDB is currently broken on v5, ignore it for now

@aristov

aristov commented May 25, 2020

Copy link
Copy Markdown
Contributor Author

This need a port to master branch first

Should I rebase this branch from master and change the PR's target branch to master, or create a new PR?

@sushantdhiman

Copy link
Copy Markdown
Contributor

Should I rebase this branch from master and change the PR's target branch to master, or create a new PR?

Depends if you are looking to have this released to v5. If you are just fixing the bug (thank you), just set target to master

@Bat-Orshikh

Copy link
Copy Markdown

Let me know If anybody cares. Then I complete the PR by tests.

@aristov

I need those changes on my production environment.
So I am waiting this PR gets merged.

@sushantdhiman
Please merge it as soon as possible. 🙏 🙏 🙏

@aristov

aristov commented May 26, 2020

Copy link
Copy Markdown
Contributor Author

This need a port to master branch first

Done: #12316

@sushantdhiman
sushantdhiman merged commit 5c733ef into sequelize:v5 May 26, 2020
@sushantdhiman

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.21.11 🎉

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

released status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants