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(query-generator): handle field names in scope exclude… #10718

Merged

Conversation

amitaymolko
Copy link
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 follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Additional fix to issue: #10399
Adds fix for using attribute field names

@eseliger
Copy link
Member

eseliger commented Apr 8, 2019

could you explain what didn't work before with the field names?

@amitaymolko
Copy link
Contributor Author

If you had default scope with includes that exclude attributes with a cutom field name it didn't work.
The fix provided here: e07a7be
Didn't handle the case for custom attribute names.

You can see the test changes in the commit.

this.DefaultScopeExclude = this.sequelize.define('DefaultScopeExclude', {
        name: Sequelize.STRING,
        other_value: {
          type: Sequelize.STRING,
          field: 'otherValue'
        }
      }

if the model was defined with a field name like other_value in the test, it would try to access the column as other_value instead of otherValue and would throw an error

Cheers

@sushantdhiman sushantdhiman merged commit 4c9d18f into sequelize:master Apr 8, 2019
@sushantdhiman
Copy link
Contributor

🎉 This PR is included in version 5.2.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

@amitaymolko
Copy link
Contributor Author

Thanks for the quick release :)

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