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

Commit 91b84530 by Joel Trost Committed by Matt Broadstone

test/associations/alias.js pass

1 parent b2b4fa9b
Showing with 8 additions and 4 deletions
......@@ -528,12 +528,16 @@ module.exports = {
}
}
var associationType = include.association.associationType;
var rootKey = primaryKey;
console.log(include.association);
var joinKey = quoteIdentifier(include.association.foreignKey);
var rootKey,joinKey;
if(associationType === 'BelongsTo'){
rootKey = quoteIdentifier(include.association.foreignKey);
joinKey = primaryKey;
}else if (associationType === 'HasMany'){
rootKey = primaryKey;
joinKey = quoteIdentifier(include.association.identifier);
}else{
rootKey = primaryKey;
joinKey = quoteIdentifier(include.association.foreignKey);
}
var joinType = include.required ? 'INNER JOIN' : 'LEFT OUTER JOIN';
......@@ -559,7 +563,7 @@ module.exports = {
var val = where[key];
var operator = '=';
if (val == 'NULL') {
if (val === 'NULL') {
operator = 'IS';
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!