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

Commit 52c00540 by GuilhermeReda

Removed !include.subQuery to make it work.

1 parent 07b1dfd6
Showing with 3 additions and 2 deletions
...@@ -1087,11 +1087,12 @@ module.exports = (function() { ...@@ -1087,11 +1087,12 @@ module.exports = (function() {
if (association.associationType !== 'BelongsTo') { if (association.associationType !== 'BelongsTo') {
// Alias the left attribute if the left attribute is not from a subqueried main table // Alias the left attribute if the left attribute is not from a subqueried main table
// When doing a query like SELECT aliasedKey FROM (SELECT primaryKey FROM primaryTable) only aliasedKey is available to the join, this is not the case when doing a regular select where you can't used the aliased attribute // When doing a query like SELECT aliasedKey FROM (SELECT primaryKey FROM primaryTable) only aliasedKey is available to the join, this is not the case when doing a regular select where you can't used the aliased attribute
if (!subQuery || (subQuery && !include.subQuery && include.parent.model !== mainModel)) { if (!subQuery || (subQuery && include.parent.model !== mainModel)) {
if (left.rawAttributes[attrLeft].field) { if (left.rawAttributes[attrLeft].field) {
attrLeft = left.rawAttributes[attrLeft].field; attrLeft = left.rawAttributes[attrLeft].field;
} }
} } else {
}
} }
joinOn = self.quoteTable(tableLeft) + '.' + self.quoteIdentifier(attrLeft); joinOn = self.quoteTable(tableLeft) + '.' + self.quoteIdentifier(attrLeft);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!