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

Commit 209a4f7f by Mick Hansen

Merge pull request #1734 from wbyoung/underscore-tablename

Underscore table name.
2 parents 3ced2aaa c3af8769
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.pluralize(name, this.options.language)
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!