Rename ReverseArgs -> ReverseInserts
- Remove debug comment
This commit is contained in:
parent
d4170806f5
commit
b447018220
4 changed files with 7 additions and 8 deletions
|
@ -48,7 +48,6 @@ func ({{.Function.Receiver}} *{{.LocalTable.NameGo}}) {{.Function.Name}}X(exec b
|
|||
{{- $dot := . -}}
|
||||
{{- range .Table.FKeys -}}
|
||||
{{- $rel := textsFromForeignKey $dot.PkgName $dot.Tables $dot.Table . -}}
|
||||
// TO_ONE
|
||||
{{- template "relationship_to_one_helper" $rel -}}
|
||||
{{end -}}
|
||||
{{- end -}}
|
||||
|
|
|
@ -13,7 +13,7 @@ func Test{{.LocalTable.NameGo}}ToOne{{.ForeignTable.NameGo}}_{{.Function.Name}}(
|
|||
{{end}}
|
||||
|
||||
|
||||
{{if not .Function.ReverseArgs -}}
|
||||
{{if not .Function.ReverseInserts -}}
|
||||
if err := foreign.InsertX(tx); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ type RelationshipToOneTexts struct {
|
|||
|
||||
Varname string
|
||||
Receiver string
|
||||
ReverseArgs bool
|
||||
ReverseInserts bool
|
||||
|
||||
LocalAssignment string
|
||||
ForeignAssignment string
|
||||
|
@ -88,7 +88,7 @@ func textsFromOneToOneRelationship(packageName string, tables []bdb.Table, table
|
|||
|
||||
rel := textsFromForeignKey(packageName, tables, table, fkey)
|
||||
rel.Function.Name = strmangle.TitleCase(strmangle.Singular(toMany.ForeignTable))
|
||||
rel.Function.ReverseArgs = true
|
||||
rel.Function.ReverseInserts = true
|
||||
return rel
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ func TestTextsFromForeignKey(t *testing.T) {
|
|||
expect.Function.Name = "User"
|
||||
expect.Function.Varname = "user"
|
||||
expect.Function.Receiver = "v"
|
||||
expect.Function.ReverseArgs = false
|
||||
expect.Function.ReverseInserts = false
|
||||
|
||||
expect.Function.LocalAssignment = "UserID.Int32"
|
||||
expect.Function.ForeignAssignment = "ID"
|
||||
|
@ -138,7 +138,7 @@ func TestTextsFromOneToOneRelationship(t *testing.T) {
|
|||
expect.Function.Name = "Video"
|
||||
expect.Function.Varname = "video"
|
||||
expect.Function.Receiver = "u"
|
||||
expect.Function.ReverseArgs = true
|
||||
expect.Function.ReverseInserts = true
|
||||
|
||||
expect.Function.LocalAssignment = "ID"
|
||||
expect.Function.ForeignAssignment = "UserID.Int32"
|
||||
|
|
Loading…
Reference in a new issue