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

Commit 3fb4bb81 by Sascha Depold

fixed minor bug when handling unassigned associations

1 parent 0cafd8b3
Showing with 4 additions and 1 deletions
......@@ -274,7 +274,10 @@ SequelizeTable = function(sequelize, tableName, attributes) {
})
table.prototype[assocName] = function(callback) {
_table.find(this[_table.identifier], callback)
if((this[_table.identifier] == null)||(isNaN(this[_table.identifier])))
callback([])
else
_table.find(this[_table.identifier], callback)
}
table.prototype[SequelizeHelper.SQL.addPrefix('set', assocName)] = function(object, callback) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!