不要怂,就是干,撸起袖子干!

Commit 4c9d18fd by amitaymolko Committed by Sushant

fix(query-generator): handle field names in scope include (#10718)

1 parent 75e363ee
......@@ -1426,6 +1426,8 @@ class QueryGenerator {
// includeIgnoreAttributes is used by aggregate functions
if (topLevelInfo.options.includeIgnoreAttributes !== false) {
include.model._expandAttributes(include);
Utils.mapOptionFieldNames(include, include.model);
const includeAttributes = include.attributes.map(attr => {
let attrAs = attr;
let verbatim = false;
......
......@@ -47,7 +47,11 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
this.DefaultScopeExclude = this.sequelize.define('DefaultScopeExclude', {
name: Sequelize.STRING
name: Sequelize.STRING,
other_value: {
type: Sequelize.STRING,
field: 'otherValue'
}
}, {
defaultScope: {
attributes: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!