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(scope): do not assign scope on eagerly loaded associations #9292
fix(scope): do not assign scope on eagerly loaded associations #9292
Conversation
14f7630
to
92ecf72
Compare
92ecf72
to
0d069bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, a few suggestions for tests
@@ -287,6 +298,41 @@ describe(Support.getTestDialectTeaser('associations'), () => { | |||
expect(comment.get('commentable')).to.equal('post'); | |||
}); | |||
}); | |||
it('should include associations with operator scope values', function() { | |||
const self = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for self
with arrow functions
type: 'green' | ||
}) | ||
); | ||
}).bind(this).spread(function(post, commentA, commentB, commentC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No bind
0d069bf
to
5b5f6b6
Compare
@sunshinewyin done ^^ |
fix(model): fix a bug with findSeparate docs(packages): Bump version fix(scope): backport sequelize#9292 fix(core): Fix nested savepoints Bump version
Pull Request check-list
Please make sure to review and check all of these items:
npm run test
ornpm run test-DIALECT
pass with this change (including linting)?Description of change
Fix an issue introduced by #9127 when eager loading association with complex scope, such as:
When assigning the scope to the instance in
_setInclude
, the instance's propertytype
becamecomment.type === { [Op.in]: ['blue', 'green'] }
.This fix move the assignation of the association scope only on creation.