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

Commit c3af8769 by Whitney Young

Added option for underscore table name.

1 parent 2a2e4206
Showing with 3 additions and 1 deletions
......@@ -26,6 +26,7 @@ module.exports = (function() {
validate: {},
freezeTableName: false,
underscored: false,
underscoredAll: false,
paranoid: false,
whereCollection: null,
schema: null,
......@@ -40,6 +41,7 @@ module.exports = (function() {
}, options || {})
this.sequelize = options.sequelize
this.underscored = this.underscored || this.underscoredAll
// error check options
Utils._.each(options.validate, function(validator, validatorType) {
......@@ -55,7 +57,7 @@ module.exports = (function() {
this.name = name
if (!this.options.tableName) {
this.tableName = this.options.freezeTableName ? name : Utils._.underscoredIf(Utils.pluralize(name, this.options.language), this.options.underscored)
this.tableName = this.options.freezeTableName ? name : Utils._.underscoredIf(Utils.pluralize(name, this.options.language), this.options.underscoredAll)
} else {
this.tableName = this.options.tableName
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!