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

Through model casing has a different name depending on eager or lazy loading #17201

Open
3 of 6 tasks
ephys opened this issue Mar 25, 2024 · 1 comment
Open
3 of 6 tasks

Comments

@ephys
Copy link
Member

ephys commented Mar 25, 2024

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Bug Description

If you have a BelongsToMany association, and you load that association, the data of the through model will be placed on a different key depending on whether it was eager loaded or lazy loaded

When eager loaded, the key is the name of the model

When lazy loaded, the key is the name of one of the associations

To replicate the v6 behavior, the key should always be the name of the model

Reproducible Example

Here is the link to the SSCCE for this issue: sequelize/sequelize-sscce#275

Environment

  • Sequelize version: 7.0.0-alpha.36
  • Node.js version: v18.16.0
  • If TypeScript related: TypeScript version: N/A
  • Database & Version: Reproduced on sqlite, postgres 14
  • Connector library & Version: pg 8.11.3

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.

Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.

@ephys ephys added type: bug pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet and removed pending-approval Bug reports that have not been verified yet, or feature requests that have not been accepted yet labels Mar 25, 2024
@shraf
Copy link

shraf commented Apr 14, 2024

i want to work on this issue, is there an opened branch to work on or should i fork & create a new PR? @ephys

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

No branches or pull requests

2 participants