Skip to content

Commit

Permalink
Check all memebers when loading relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenafamo committed Apr 25, 2023
1 parent 46d7014 commit 73ddb1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gen/templates/models/10_rel_load.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ func (os {{$tAlias.UpSingular}}Slice) Load{{$tAlias.UpSingular}}{{$relAlias}}(ct
}
{{- end}}

for _, rel := range {{$fAlias.DownPlural}} {
for _, o := range os {
for _, o := range os {
for _, rel := range {{$fAlias.DownPlural}} {
{{range $index, $local := $side.FromColumns -}}
{{- $foreign := index $side.ToColumns $index -}}
{{- $fromColGet := columnGetter $.Tables $side.From $fromAlias $local -}}
Expand Down Expand Up @@ -287,8 +287,8 @@ func (os {{$tAlias.UpSingular}}Slice) Load{{$tAlias.UpSingular}}{{$relAlias}}(ct
}
{{- end}}

for _, rel := range {{$fAlias.DownPlural}} {
for _, o := range os {
for _, o := range os {
for _, rel := range {{$fAlias.DownPlural}} {
{{range $index, $local := $firstSide.FromColumns -}}
{{- $fromCol := index $firstFrom.Columns $local -}}
if o.{{$fromCol}} != rel.Related{{$fromCol}} {
Expand Down

0 comments on commit 73ddb1f

Please sign in to comment.