mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: skip enum identifier checks in case it has custom Go type (#2766)
Fixes https://github.com/ent/ent/issues/2756
This commit is contained in:
@@ -223,7 +223,7 @@ const DefaultRole role.Role = "READ"
|
||||
// RoleValidator is a validator for the "role" field enum values. It is called by the builders before save.
|
||||
func RoleValidator(r role.Role) error {
|
||||
switch r {
|
||||
case "ADMIN", "OWNER", "USER", "READ", "WRITE":
|
||||
case "ADMIN", "OWNER", "USER", "READ", "WRITE", "READ+WRITE":
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("fieldtype: invalid enum value for role field: %q", r)
|
||||
|
||||
Reference in New Issue
Block a user