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

Commit 4d52706a by Jan Aagaard Meier

Return the correct object if the association already exists in add

1 parent 6292923b
Showing with 1 additions and 1 deletions
......@@ -375,7 +375,7 @@ module.exports = (function() {
var Class = Object(association.through) === association.through ? HasManyDoubleLinked : HasManySingleLinked
return new Class(association, instance).injectAdder(newInstance, additionalAttributes, !!currentAssociatedObjects.length)
} else {
return Utils.Promise.resolve(currentAssociatedObjects[1])
return Utils.Promise.resolve(currentAssociatedObjects[0])
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!