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

Commit 0774f45a by Sascha Depold

Merge pull request #278 from robraux/association_overwrite

Association injections overwrite existing defined validations
2 parents 58651691 865a173e
......@@ -24,7 +24,7 @@ module.exports = (function() {
this.identifier = this.options.foreignKey || Utils._.underscoredIf(Utils.singularize(this.target.tableName) + "Id", this.source.options.underscored)
newAttributes[this.identifier] = { type: DataTypes.INTEGER }
Utils._.extend(this.source.rawAttributes, newAttributes)
Utils._.defaults(this.source.rawAttributes, newAttributes)
return this
}
......
......@@ -63,7 +63,7 @@ module.exports = (function() {
} else {
var newAttributes = {}
newAttributes[this.identifier] = { type: DataTypes.INTEGER }
Utils._.extend(this.target.rawAttributes, newAttributes)
Utils._.defaults(this.target.rawAttributes, newAttributes)
}
return this
......
......@@ -29,7 +29,7 @@ module.exports = (function() {
this.identifier = this.options.foreignKey || Utils._.underscoredIf(Utils.singularize(this.source.tableName) + "Id", this.options.underscored)
newAttributes[this.identifier] = { type: DataTypes.INTEGER }
Utils._.extend(this.target.rawAttributes, newAttributes)
Utils._.defaults(this.target.rawAttributes, newAttributes)
return this
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!