Remove unuseful text helper variable
This commit is contained in:
parent
04031a5c6f
commit
5ba6769134
6 changed files with 4 additions and 9 deletions
|
@ -18,7 +18,7 @@ func (o *{{$txt.LocalTable.NameGo}}) {{$txt.Function.Name}}(exec boil.Executor,
|
|||
queryMods = append(queryMods, mods...)
|
||||
|
||||
query := {{$txt.ForeignTable.NamePluralGo}}(exec, queryMods...)
|
||||
queries.SetFrom(query.Query, "{{$txt.ForeignTable.Name | $dot.SchemaTable}}")
|
||||
queries.SetFrom(query.Query, "{{.ForeignTable | $dot.SchemaTable}}")
|
||||
|
||||
return query
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func (o *{{$txt.LocalTable.NameGo}}) {{$txt.Function.Name}}(exec boil.Executor,
|
|||
queryMods = append(queryMods, mods...)
|
||||
|
||||
query := {{$txt.ForeignTable.NamePluralGo}}(exec, queryMods...)
|
||||
queries.SetFrom(query.Query, "{{$txt.ForeignTable.Name | $dot.SchemaTable}}")
|
||||
queries.SetFrom(query.Query, "{{.ForeignTable | $dot.SchemaTable}}")
|
||||
|
||||
return query
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ func ({{$varNameSingular}}L) Load{{$txt.Function.Name}}(e boil.Executor, singula
|
|||
}
|
||||
|
||||
{{if not $dot.NoHooks -}}
|
||||
if len({{$txt.ForeignTable.Name | singular | camelCase}}AfterSelectHooks) != 0 {
|
||||
if len({{$varNameSingular}}AfterSelectHooks) != 0 {
|
||||
for _, obj := range resultSlice {
|
||||
if err := obj.doAfterSelectHooks(e); err != nil {
|
||||
return err
|
||||
|
|
|
@ -50,7 +50,7 @@ func ({{$varNameSingular}}L) Load{{$txt.Function.Name}}(e boil.Executor, singula
|
|||
}
|
||||
|
||||
{{if not $dot.NoHooks -}}
|
||||
if len({{$txt.ForeignTable.Name | singular | camelCase}}AfterSelectHooks) != 0 {
|
||||
if len({{$varNameSingular}}AfterSelectHooks) != 0 {
|
||||
for _, obj := range resultSlice {
|
||||
if err := obj.doAfterSelectHooks(e); err != nil {
|
||||
return err
|
||||
|
|
|
@ -21,7 +21,6 @@ type TxtToOne struct {
|
|||
ForeignTable struct {
|
||||
NameGo string
|
||||
NamePluralGo string
|
||||
Name string
|
||||
ColumnNameGo string
|
||||
ColumnName string
|
||||
}
|
||||
|
@ -46,7 +45,6 @@ func txtsFromFKey(tables []bdb.Table, table bdb.Table, fkey bdb.ForeignKey) TxtT
|
|||
r.LocalTable.NameGo = strmangle.TitleCase(strmangle.Singular(table.Name))
|
||||
r.LocalTable.ColumnNameGo = strmangle.TitleCase(strmangle.Singular(fkey.Column))
|
||||
|
||||
r.ForeignTable.Name = fkey.ForeignTable
|
||||
r.ForeignTable.NameGo = strmangle.TitleCase(strmangle.Singular(fkey.ForeignTable))
|
||||
r.ForeignTable.NamePluralGo = strmangle.TitleCase(strmangle.Plural(fkey.ForeignTable))
|
||||
r.ForeignTable.ColumnName = fkey.ForeignColumn
|
||||
|
|
|
@ -26,7 +26,6 @@ func TestTxtsFromOne(t *testing.T) {
|
|||
expect.LocalTable.NameGo = "Jet"
|
||||
expect.LocalTable.ColumnNameGo = "PilotID"
|
||||
|
||||
expect.ForeignTable.Name = "pilots"
|
||||
expect.ForeignTable.NameGo = "Pilot"
|
||||
expect.ForeignTable.NamePluralGo = "Pilots"
|
||||
expect.ForeignTable.ColumnName = "id"
|
||||
|
@ -50,7 +49,6 @@ func TestTxtsFromOne(t *testing.T) {
|
|||
expect.LocalTable.NameGo = "Jet"
|
||||
expect.LocalTable.ColumnNameGo = "AirportID"
|
||||
|
||||
expect.ForeignTable.Name = "airports"
|
||||
expect.ForeignTable.NameGo = "Airport"
|
||||
expect.ForeignTable.NamePluralGo = "Airports"
|
||||
expect.ForeignTable.ColumnName = "id"
|
||||
|
@ -101,7 +99,6 @@ func TestTxtsFromOneToOne(t *testing.T) {
|
|||
expect.LocalTable.NameGo = "Pilot"
|
||||
expect.LocalTable.ColumnNameGo = "ID"
|
||||
|
||||
expect.ForeignTable.Name = "jets"
|
||||
expect.ForeignTable.NameGo = "Jet"
|
||||
expect.ForeignTable.NamePluralGo = "Jets"
|
||||
expect.ForeignTable.ColumnName = "pilot_id"
|
||||
|
|
Loading…
Add table
Reference in a new issue