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

Commit 7e260791 by Mick Hansen

feat(hasMany): addAssociation is no-op if passed false/null/undefined

1 parent 0207b478
Showing with 3 additions and 0 deletions
......@@ -367,6 +367,9 @@ module.exports = (function() {
};
obj[this.accessors.add] = function(newInstance, additionalAttributes) {
// If newInstance is null or undefined, no-op
if (!newInstance) return Utils.Promise.resolve();
var instance = this
, primaryKeyAttribute = association.target.primaryKeyAttribute;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!