Correct improper detection of one-to-one

This commit is contained in:
Aaron L 2016-08-13 15:28:54 -07:00
parent 641a433a2d
commit 1875bac7cf
3 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ type {{$modelName}}Relationships struct {
{{- template "relationship_to_one_struct_helper" $rel}}
{{end -}}
{{- range .Table.ToManyRelationships -}}
{{- if .ForeignColumnUnique -}}
{{- if (and .ForeignColumnUnique (not .ToJoinTable)) -}}
{{- template "relationship_to_one_struct_helper" (textsFromOneToOneRelationship $dot.PkgName $dot.Tables $dot.Table .)}}
{{else -}}
{{- $rel := textsFromRelationship $dot.Tables $dot.Table . -}}

View file

@ -3,7 +3,7 @@
{{- $dot := . -}}
{{- $table := .Table -}}
{{- range .Table.ToManyRelationships -}}
{{- if .ForeignColumnUnique -}}
{{- if (and .ForeignColumnUnique (not .ToJoinTable)) -}}
{{- template "relationship_to_one_helper" (textsFromOneToOneRelationship $dot.PkgName $dot.Tables $table .) -}}
{{- else -}}
{{- $rel := textsFromRelationship $dot.Tables $table . -}}

View file

@ -3,7 +3,7 @@
{{- $dot := . }}
{{- $table := .Table }}
{{- range .Table.ToManyRelationships -}}
{{- if .ForeignColumnUnique -}}
{{- if (and .ForeignColumnUnique (not .ToJoinTable)) -}}
{{- template "relationship_to_one_test_helper" (textsFromOneToOneRelationship $dot.PkgName $dot.Tables $table .) -}}
{{- else -}}
{{- $rel := textsFromRelationship $dot.Tables $table . -}}