Make sure join tables get ToMany Set/Remove
This commit is contained in:
parent
4b1c934751
commit
b101df0a24
1 changed files with 3 additions and 3 deletions
|
@ -7,9 +7,9 @@
|
|||
{{- if (and .ForeignColumnUnique (not .ToJoinTable)) -}}
|
||||
{{- template "relationship_to_one_setops_helper" (textsFromOneToOneRelationship $dot.PkgName $dot.Tables $table .) -}}
|
||||
{{- else -}}
|
||||
{{- $rel := textsFromRelationship $dot.Tables $table .}}
|
||||
{{- $rel := textsFromRelationship $dot.Tables $table . -}}
|
||||
{{- $localNameSingular := .Table | singular | camelCase -}}
|
||||
{{- $foreignNameSingular := .ForeignTable | singular | camelCase -}}
|
||||
{{- $foreignNameSingular := .ForeignTable | singular | camelCase}}
|
||||
|
||||
// Add{{$rel.Function.Name}} adds the given related objects to the existing relationships
|
||||
// of the {{$table.Name | singular}}, optionally inserting them as new records.
|
||||
|
@ -84,7 +84,7 @@ func ({{$rel.Function.Receiver}} *{{$rel.LocalTable.NameGo}}) Add{{$rel.Function
|
|||
|
||||
return nil
|
||||
}
|
||||
{{- if .ForeignColumnNullable}}
|
||||
{{- if (or .ForeignColumnNullable .ToJoinTable)}}
|
||||
|
||||
// Set{{$rel.Function.Name}} removes all previously related items of the
|
||||
// {{$table.Name | singular}} replacing them completely with the passed
|
||||
|
|
Loading…
Add table
Reference in a new issue