Skip to content

Commit

Permalink
use aliased field name for lastID
Browse files Browse the repository at this point in the history
  • Loading branch information
motemen committed Nov 22, 2023
1 parent 6210ed1 commit edf678b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions templates/main/15_insert.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ func (o *{{$alias.UpSingular}}) Insert({{if .NoContext}}exec boil.Executor{{else

{{$colName := index .Table.PKey.Columns 0 -}}
{{- $col := .Table.GetColumn $colName -}}
{{- $colTitled := $colName | titleCase}}
o.{{$colTitled}} = {{$col.Type}}(lastID)
o.{{$alias.Column $colName}} = {{$col.Type}}(lastID)
if lastID != 0 && len(cache.retMapping) == 1 && cache.retMapping[0] == {{$alias.DownSingular}}Mapping["{{$colName}}"] {
goto CacheNoHooks
}
Expand Down

0 comments on commit edf678b

Please sign in to comment.