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

Commit 73f08f8f by Mick Hansen

fix test

1 parent 7c4611d0
...@@ -169,7 +169,7 @@ module.exports = (function() { ...@@ -169,7 +169,7 @@ module.exports = (function() {
} else { } else {
// Check if we have included models, and if this key matches the include model names/aliases // Check if we have included models, and if this key matches the include model names/aliases
if (this.options && this.options.include && this.options.includeNames.indexOf(key) !== -1) { if (this.options && this.options.include && this.options.includeNames.indexOf(key) !== -1 && value) {
// Pass it on to the include handler // Pass it on to the include handler
this._setInclude(key, value, options) this._setInclude(key, value, options)
return return
......
...@@ -413,6 +413,7 @@ module.exports = (function() { ...@@ -413,6 +413,7 @@ module.exports = (function() {
if (!options.checkExisting) { if (!options.checkExisting) {
parseChildren(existingResult) parseChildren(existingResult)
} }
}) })
// parseChildren after row parsing if duplicate values are possible // parseChildren after row parsing if duplicate values are possible
......
...@@ -40,7 +40,7 @@ describe(Support.getTestDialectTeaser("Include"), function () { ...@@ -40,7 +40,7 @@ describe(Support.getTestDialectTeaser("Include"), function () {
it('should not throw an error when an empty include is named the same as the foreign key', function (done) { it('should not throw an error when an empty include is named the same as the foreign key', function (done) {
var section = this.sequelize.define('section', { name: DataTypes.STRING }); var section = this.sequelize.define('section', { name: DataTypes.STRING });
var layout = this.sequelize.define('layout', { name: DataTypes.STRING }); var layout = this.sequelize.define('layout', { name: DataTypes.STRING });
section.belongsTo(layout, { section.belongsTo(layout, {
as: layout.name, as: layout.name,
foreignKey: layout.name, foreignKey: layout.name,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!