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

Commit 4886b866 by Simon Schick Committed by Sushant

fix(query-generator): fix bad property access (#10056)

1 parent a0545bf2
Showing with 4 additions and 7 deletions
...@@ -599,11 +599,10 @@ class QueryGenerator { ...@@ -599,11 +599,10 @@ class QueryGenerator {
const fieldsSql = options.fields.map(field => { const fieldsSql = options.fields.map(field => {
if (typeof field === 'string') { if (typeof field === 'string') {
return this.quoteIdentifier(field); return this.quoteIdentifier(field);
} else if (field._isSequelizeMethod) { }
if (field instanceof Utils.SequelizeMethod) {
return this.handleSequelizeMethod(field); return this.handleSequelizeMethod(field);
} else { }
let result = '';
if (field.attribute) { if (field.attribute) {
field.name = field.attribute; field.name = field.attribute;
} }
...@@ -612,9 +611,7 @@ class QueryGenerator { ...@@ -612,9 +611,7 @@ class QueryGenerator {
throw new Error(`The following index field has no name: ${field}`); throw new Error(`The following index field has no name: ${field}`);
} }
result += this.quoteIdentifier(field.name); return this.quoteIdentifier(field.name);
return result;
}
}); });
const fieldsSqlQuotedString = fieldsSql.join(', '); const fieldsSqlQuotedString = fieldsSql.join(', ');
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!