Skip to content

Commit

Permalink
Fix tablize with camel case (#23)
Browse files Browse the repository at this point in the history
Fixes #21.
  • Loading branch information
stanislas-m committed Aug 21, 2019
1 parent 751c521 commit 3a6917a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion name/tablize.go
Expand Up @@ -13,5 +13,5 @@ func Tableize(s string) string {
// Person = persons
// Admin/Widget = admin_widgets
func (i Ident) Tableize() Ident {
return Ident{i.Pluralize().Underscore()}
return Ident{i.Underscore().Pluralize()}
}
1 change: 1 addition & 0 deletions name/tablize_test.go
Expand Up @@ -23,6 +23,7 @@ func Test_Tableize(t *testing.T) {
{"statuses", "statuses"},
{"People", "people"},
{"people", "people"},
{"BigPerson", "big_people"},
}

for _, tt := range table {
Expand Down
1 change: 1 addition & 0 deletions plural_rules.go
Expand Up @@ -166,6 +166,7 @@ func init() {
AddPlural("atus", "atuses")
AddPlural("ode", "odes")
AddPlural("person", "people")
AddPlural("hello", "hellos")
AddPlural("va", "vae")
AddPlural("leus", "li")
AddPlural("oot", "eet")
Expand Down

0 comments on commit 3a6917a

Please sign in to comment.