mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: allow if field to use field.Other with custom types (#2309)
* fix ID with field.Other comparing with zero * fix lint * Update entc/integration/customid/ent/schema/other.go Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com> * re-generate code Co-authored-by: Ariel Mashraki <7413593+a8m@users.noreply.github.com>
This commit is contained in:
@@ -51,7 +51,7 @@ func ({{ $receiver }} *{{ $.Name }}) assignValues(columns []string, values []int
|
||||
for {{ $idx }} := range columns {
|
||||
switch columns[{{ $idx }}] {
|
||||
case {{ $.Package }}.{{ $.ID.Constant }}:
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID $.ID.IsBytes) }}
|
||||
{{- if and $.ID.UserDefined (or $.ID.IsString $.ID.IsUUID $.ID.IsBytes $.ID.IsOther) }}
|
||||
{{- with extend $ "Idx" $idx "Field" $.ID "Rec" $receiver }}
|
||||
{{ template "dialect/sql/decode/field" . }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user