Rename ReverseArgs -> ReverseInserts

- Remove debug comment
This commit is contained in:
Aaron L 2016-07-17 17:52:55 -07:00
parent d4170806f5
commit b447018220
4 changed files with 7 additions and 8 deletions

View file

@ -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 -}}

View file

@ -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)
}

View file

@ -28,9 +28,9 @@ type RelationshipToOneTexts struct {
PackageName string
Name string
Varname string
Receiver string
ReverseArgs bool
Varname string
Receiver string
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
}

View file

@ -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"