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

Commit 4be6547c by sdepold

fixed missing options

1 parent 5fc15814
Showing with 5 additions and 2 deletions
......@@ -15,19 +15,22 @@ module.exports = (function() {
HasManySingleLinked.prototype.injectSetter = function(emitter, oldAssociations, newAssociations) {
var self = this
, options = this.options || {}
// clear the old associations
oldAssociations.forEach(function(associatedObject) {
associatedObject[self.__factory.identifier] = self.options.omitNull ? '' : null
associatedObject[self.__factory.identifier] = options.omitNull ? '' : null
associatedObject.save()
})
// set the new one
var chainer = new Utils.QueryChainer
var chainer = new Utils.QueryChainer()
newAssociations.forEach(function(associatedObject) {
associatedObject[self.__factory.identifier] = self.instance.id
chainer.add(associatedObject.save())
})
chainer
.run()
.success(function() { emitter.emit('success', newAssociations) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!