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

Commit ae153ee6 by Mick Hansen

Fix it so foreignKeys dont get overwritten on hasOne/belongsTo call targeting opposite

1 parent 995d9819
Showing with 1 additions and 1 deletions
......@@ -39,8 +39,8 @@ module.exports = (function() {
this.identifier = this.options.foreignKey || Utils._.underscoredIf(Utils.singularize(this.source.tableName, this.source.options.language) + "Id", this.options.underscored)
newAttributes[this.identifier] = { type: this.options.keyType || keyType }
Helpers.addForeignKeyConstraints(newAttributes[this.identifier], this.source, this.target, this.options)
Utils._.defaults(this.target.rawAttributes, newAttributes)
Helpers.addForeignKeyConstraints(this.target.rawAttributes[this.identifier], this.source, this.target, this.options)
// Sync attributes and setters/getters to DAO prototype
this.target.refreshAttributes()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!