mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: fix eager loading when using uuid for foreign keys failing if loading more than a single relation (#533)
* Bugfix: eager lodaing when using uuid for foreign keys failing if loading more than a single relation (#532) * go generate ./... output
This commit is contained in:
@@ -58,7 +58,7 @@ func ({{ $receiver }} *{{ $.Name }}) assignValues(values ...interface{}) error {
|
||||
{{- range $i, $fk := . }}
|
||||
{{- $f := $fk.Field }}
|
||||
{{- if and $f.UserDefined (or $f.IsString $f.IsUUID) }}
|
||||
{{- with extend $ "Idx" 0 "Field" $f "Rec" $receiver "StructField" $f.Name }}
|
||||
{{- with extend $ "Idx" $i "Field" $f "Rec" $receiver "StructField" $f.Name }}
|
||||
{{ template "dialect/sql/decode/field" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
@@ -118,4 +118,4 @@ func ({{ $receiver }} *{{ $.Name }}) assignValues(values ...interface{}) error {
|
||||
{{- $f := $fk.Field }}
|
||||
{{ $f.Name }} {{ if $f.Nillable }}*{{ end }}{{ $f.Type }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user