mirror of https://github.com/go-gorm/gorm.git
SingularTable for JoinTable
This commit is contained in:
parent
9bfe306975
commit
2d048d9ece
|
@ -41,6 +41,9 @@ func (ns NamingStrategy) ColumnName(table, column string) string {
|
||||||
|
|
||||||
// JoinTableName convert string to join table name
|
// JoinTableName convert string to join table name
|
||||||
func (ns NamingStrategy) JoinTableName(str string) string {
|
func (ns NamingStrategy) JoinTableName(str string) string {
|
||||||
|
if ns.SingularTable {
|
||||||
|
return ns.TablePrefix + toDBName(str)
|
||||||
|
}
|
||||||
return ns.TablePrefix + inflection.Plural(toDBName(str))
|
return ns.TablePrefix + inflection.Plural(toDBName(str))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue