Go-Back-Skeleton/vendor/github.com/go-pg/pg/orm/inflection.go
2017-09-25 20:20:52 +02:00

17 lines
378 B
Go

package orm
import (
"github.com/jinzhu/inflection"
)
var tableNameInflector func(string) string
func init() {
SetTableNameInflector(inflection.Plural)
}
// SetTableNameInflector overrides the default func that pluralizes
// model name to get table name, e.g. my_article becomes my_articles.
func SetTableNameInflector(fn func(string) string) {
tableNameInflector = fn
}