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

Commit a952132d by Mick Hansen

fix(plugins): have counter-cache use correct way of defining default values

1 parent f61ada76
Showing with 4 additions and 7 deletions
......@@ -45,15 +45,12 @@ module.exports = (function() {
newAttributes[this.columnName] = {
type: DataTypes.INTEGER,
allowNull: false
};
// apparently you can't set defaultValues after model definition
this.source._defaultValues[this.columnName] = Utils._.partial(
allowNull: false,
defaultValue: Utils._.partial(
Utils.toDefaultValue,
0
);
this.source._hasDefaultValues = true;
)
};
Utils.mergeDefaults(this.source.rawAttributes, newAttributes);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!