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

Commit 5a79c52a by Jan Aagaard Meier

Merge pull request #1923 from LJ1102/fix-has-many-double-linked-join-table-attribute-updates

Fixes has-many-dobule-linked join table attribute changes on injected setter
2 parents 356a9bb3 2afceddc
Showing with 2 additions and 2 deletions
...@@ -128,8 +128,8 @@ module.exports = (function() { ...@@ -128,8 +128,8 @@ module.exports = (function() {
attributes: Utils._.defaults({}, throughAttributes, defaultAttributes) attributes: Utils._.defaults({}, throughAttributes, defaultAttributes)
} }
changedAssociation.where[self.association.identifier] = self.instance[self.association.identifier] || self.instance.id changedAssociation.where[self.association.identifier] = self.instance[self.association.identifier] || self.instance[self.association.source.primaryKeyAttributes[0]] || self.instance.id
changedAssociation.where[foreignIdentifier] = newObj[foreignIdentifier] || newObj.id changedAssociation.where[foreignIdentifier] = newObj[foreignIdentifier] || newObj[self.association.target.primaryKeyAttributes[0]] || newObj.id
if (Object.keys(changedAssociation.attributes).length) { if (Object.keys(changedAssociation.attributes).length) {
changedAssociations.push(changedAssociation) changedAssociations.push(changedAssociation)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!