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

docs: joinTableAttributes in belongsToMany mixin #13902

Merged
merged 5 commits into from Jan 6, 2022

Conversation

cincodenada
Copy link
Contributor

This address sequelize/website#97 partially at least - I'm not sure where else it should be documented.

This address #11847 partially at least - I'm not sure where else it should be documented.
@cincodenada
Copy link
Contributor Author

I'm still not quite sure why this doesn't work - I see that we're manually adding an entry to the include array in belongs-to-many.js

I'm guessing this is so that we have the join model attributes by default, and because we're not controlling the join, it would be awkward to try to add it. A naive attempt at suppressing the join table would look something like:

Foo.getBars({
    include: [{
      model: Bar,
      through: { attributes: [] }
    }]
})

but that would actually attempt to join the returned Bars in turn to Bar, which won't work (or at least won't have the intended effect, and I'm not sure it's even possible for the end-user to replicate the join that's generated reasonably.

I don't know the best way to explain that succinctly - I've done my best here.

@fzn0x fzn0x changed the title Document joinTableAttributes in belongsToMany mixin docs: joinTableAttributes in belongsToMany mixin Jan 5, 2022
@fzn0x fzn0x added the type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference. label Jan 5, 2022
@fzn0x fzn0x merged commit b84aae5 into sequelize:main Jan 6, 2022
sdepold pushed a commit that referenced this pull request Jan 10, 2022
* Document `joinTableAttributes` in `belongsToMany` mixin

This address #11847 partially at least - I'm not sure where else it should be documented.

* Tweak wording a bit

* Try to make this a little clearer

Co-authored-by: fncolon <fncolon@pm.me>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2022

🎉 This PR is included in version 7.0.0-alpha.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

aliatsis pushed a commit to creditiq/sequelize that referenced this pull request Jun 2, 2022
* Document `joinTableAttributes` in `belongsToMany` mixin

This address #11847 partially at least - I'm not sure where else it should be documented.

* Tweak wording a bit

* Try to make this a little clearer

Co-authored-by: fncolon <fncolon@pm.me>
@yisibl
Copy link

yisibl commented Dec 15, 2023

Thank you very much for adding the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @v7 type: docs For issues and PRs. Things related to documentation, such as changes in the manuals / API reference.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants