Fix inflection bug for "ss" words (like address)
* Adjust inflect rules * Bump version to 2.1.8
This commit is contained in:
parent
761efee9f0
commit
e992e327c2
3 changed files with 26 additions and 1 deletions
2
main.go
2
main.go
|
@ -14,7 +14,7 @@ import (
|
||||||
"github.com/vattle/sqlboiler/boilingcore"
|
"github.com/vattle/sqlboiler/boilingcore"
|
||||||
)
|
)
|
||||||
|
|
||||||
const sqlBoilerVersion = "2.1.7"
|
const sqlBoilerVersion = "2.1.8"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
cmdState *boilingcore.State
|
cmdState *boilingcore.State
|
||||||
|
|
|
@ -92,6 +92,10 @@ func newBoilRuleset() *inflect.Ruleset {
|
||||||
rs.AddPluralExact("oxen", "oxen", true)
|
rs.AddPluralExact("oxen", "oxen", true)
|
||||||
rs.AddPluralExact("quiz", "quizzes", true)
|
rs.AddPluralExact("quiz", "quizzes", true)
|
||||||
rs.AddSingular("s", "")
|
rs.AddSingular("s", "")
|
||||||
|
rs.AddSingular("ss", "ss")
|
||||||
|
rs.AddSingular("as", "as")
|
||||||
|
rs.AddSingular("us", "us")
|
||||||
|
rs.AddSingular("is", "is")
|
||||||
rs.AddSingular("news", "news")
|
rs.AddSingular("news", "news")
|
||||||
rs.AddSingular("ta", "tum")
|
rs.AddSingular("ta", "tum")
|
||||||
rs.AddSingular("ia", "ium")
|
rs.AddSingular("ia", "ium")
|
||||||
|
@ -184,5 +188,15 @@ func newBoilRuleset() *inflect.Ruleset {
|
||||||
rs.AddIrregular("move", "moves")
|
rs.AddIrregular("move", "moves")
|
||||||
rs.AddIrregular("zombie", "zombies")
|
rs.AddIrregular("zombie", "zombies")
|
||||||
rs.AddIrregular("cookie", "cookies")
|
rs.AddIrregular("cookie", "cookies")
|
||||||
|
rs.AddSingularExact("a", "a", true)
|
||||||
|
rs.AddSingularExact("i", "i", true)
|
||||||
|
rs.AddSingularExact("is", "is", true)
|
||||||
|
rs.AddSingularExact("us", "us", true)
|
||||||
|
rs.AddSingularExact("as", "as", true)
|
||||||
|
rs.AddPluralExact("a", "a", true)
|
||||||
|
rs.AddPluralExact("i", "i", true)
|
||||||
|
rs.AddPluralExact("is", "is", true)
|
||||||
|
rs.AddPluralExact("us", "us", true)
|
||||||
|
rs.AddPluralExact("as", "as", true)
|
||||||
return rs
|
return rs
|
||||||
}
|
}
|
||||||
|
|
11
testdata/postgres_test_schema.sql
vendored
11
testdata/postgres_test_schema.sql
vendored
|
@ -306,6 +306,17 @@ create table worms (
|
||||||
foreign key (tiger_id) references tigers (id)
|
foreign key (tiger_id) references tigers (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table addresses (
|
||||||
|
id bytea primary key,
|
||||||
|
name bytea null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table houses (
|
||||||
|
id bytea primary key,
|
||||||
|
name bytea not null,
|
||||||
|
address_id bytea not null unique,
|
||||||
|
foreign key (address_id) references addresses (id)
|
||||||
|
);
|
||||||
|
|
||||||
create table byte_pilots (
|
create table byte_pilots (
|
||||||
id bytea primary key not null,
|
id bytea primary key not null,
|
||||||
|
|
Loading…
Reference in a new issue