Skip to content

Commit 96da65f

Browse files
authored
Merge pull request #586 from TylerJGabb/issue-585
fix: #585 Many-to-Many Loader Skipping Related Rows
2 parents 66620ae + 25677aa commit 96da65f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed a bug where the generated loaders for many-to-many relationships were skipping related rows. (thanks @TylerJGabb)
13+
1014
### Added
1115

1216
- Include `shell.nix` for developers using [Nix](https://nixos.org/) to create development environments

gen/templates/loaders/table/110_loaders.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (os {{$tAlias.UpSingular}}Slice) Load{{$relAlias}}(ctx context.Context, exe
380380

381381
{{- $typInfo := $.Types.Index ($.Tables.GetColumn $firstSide.From $local).Type -}}
382382
{{- with $.Types.GetCompareExpr $.CurrentPackage $.Importer $fromColDef.Type $fromColDef.Nullable $toColDef.Nullable -}}
383-
if {{replace "AAA" $fromColGet . | replace "BBB" $toColGet}} {
383+
if !({{replace "AAA" $fromColGet . | replace "BBB" $toColGet}}) {
384384
continue
385385
}
386386
{{- end}}

0 commit comments

Comments
 (0)