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

Commit d23453be by Sascha Depold

addPrefix can now singularize when passing true as third param

1 parent e17363b1
Showing with 3 additions and 2 deletions
...@@ -26,8 +26,9 @@ exports.Helper = function(Sequelize) { ...@@ -26,8 +26,9 @@ exports.Helper = function(Sequelize) {
return Helper.Inflection.singularize(_name) + "Id" return Helper.Inflection.singularize(_name) + "Id"
}, },
addPrefix: function(prefix, string) { addPrefix: function(prefix, string, singularize) {
return prefix + string[0].toUpperCase() + string.replace(/^./, "") var _string = singularize ? Helper.Inflection.singularize(string) : string
return prefix + _string[0].toUpperCase() + _string.replace(/^./, "")
}, },
asTableName: function(name) { asTableName: function(name) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!