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

Commit a7d6a4e3 by Lemon

Fixed has-many associations to have foreignIdentifier in both directions

1 parent bef2f61c
Showing with 2 additions and 0 deletions
......@@ -47,7 +47,9 @@ module.exports = (function() {
this.foreignIdentifier = Utils._.underscoredIf((this.options.as || this.target.tableName) + 'Id', this.options.underscored)
} else {
this.foreignIdentifier = this.target.associations[this.associationAccessor].identifier
this.target.associations[this.associationAccessor].foreignIdentifier = this.identifier
delete this.source.rawAttributes[this.foreignIdentifier]
delete this.target.associations[this.associationAccessor].source.rawAttributes[this.identifier]
}
// define a new model, which connects the models
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!