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

Commit cb94fa88 by Mick Hansen

Make previous tests run atleast

1 parent 30bd3b08
...@@ -538,7 +538,7 @@ module.exports = (function() { ...@@ -538,7 +538,7 @@ module.exports = (function() {
return self.quoteIdentifier(as) + "." + self.quoteIdentifier(attr) + " AS " + self.quoteIdentifier(as + "." + attr) return self.quoteIdentifier(as) + "." + self.quoteIdentifier(attr) + " AS " + self.quoteIdentifier(as + "." + attr)
}) })
if (subQuery && include.hasIncludeRequired || include.required) { if (subQuery && (include.hasIncludeRequired || include.required)) {
subQueryAttributes = subQueryAttributes.concat(attributes) subQueryAttributes = subQueryAttributes.concat(attributes)
} else { } else {
mainAttributes = mainAttributes.concat(attributes) mainAttributes = mainAttributes.concat(attributes)
...@@ -553,7 +553,7 @@ module.exports = (function() { ...@@ -553,7 +553,7 @@ module.exports = (function() {
}) })
if (options.includeIgnoreAttributes !== false) { if (options.includeIgnoreAttributes !== false) {
if (subQuery && include.hasIncludeRequired || include.required) { if (subQuery && (include.hasIncludeRequired || include.required)) {
subQueryAttributes = subQueryAttributes.concat(attributes) subQueryAttributes = subQueryAttributes.concat(attributes)
} else { } else {
mainAttributes = mainAttributes.concat(throughAttributes) mainAttributes = mainAttributes.concat(throughAttributes)
...@@ -610,14 +610,14 @@ module.exports = (function() { ...@@ -610,14 +610,14 @@ module.exports = (function() {
options.include.forEach(function(include) { options.include.forEach(function(include) {
var joinQueryItem = generateJoinQuery(include, tableName) var joinQueryItem = generateJoinQuery(include, tableName)
if (include.hasIncludeWhere || include.where) { if (subQuery && (include.hasIncludeWhere || include.where)) {
subJoinQueries.push(joinQueryItem) subJoinQueries.push(joinQueryItem)
} else { } else {
mainJoinQueries.push(joinQueryItem) mainJoinQueries.push(joinQueryItem)
} }
}.bind(this)) }.bind(this))
} }
if (subQuery) { if (subQuery) {
subQueryItems.push("SELECT " + subQueryAttributes.join(',') + " FROM " + options.table) subQueryItems.push("SELECT " + subQueryAttributes.join(',') + " FROM " + options.table)
subQueryItems.push(subJoinQueries.join('')) subQueryItems.push(subJoinQueries.join(''))
......
...@@ -889,7 +889,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -889,7 +889,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
}) })
}) })
it.only('should be possible to extend the on clause with a where option on nested includes', function (done) { it('should be possible to extend the on clause with a where option on nested includes', function (done) {
var User = this.sequelize.define('User', {}) var User = this.sequelize.define('User', {})
, Product = this.sequelize.define('Product', { , Product = this.sequelize.define('Product', {
title: DataTypes.STRING title: DataTypes.STRING
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!