mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
entql: check for uuid when generating ID predicate (#1006)
This commit is contained in:
committed by
Ariel Mashraki
parent
a20ce535d1
commit
425d789d96
File diff suppressed because one or more lines are too long
@@ -109,6 +109,7 @@ type predicateAdder interface {
|
||||
|
||||
{{ $type := $n.ID.Type.Type.String }}
|
||||
{{ $iface := print (pascal $type) "P" }}
|
||||
{{ if $n.ID.IsUUID }}{{ $iface = "ValueP" }}{{ end }}
|
||||
// WhereID applies the entql {{ $type }} predicate on the id field.
|
||||
func (f *{{ $filter }}) WhereID(p entql.{{ $iface }}) {
|
||||
f.Where(p.Field({{ $n.Package }}.{{ $n.ID.Constant }}))
|
||||
|
||||
Reference in New Issue
Block a user