check runs all checks and user-defined validators on the builder.
()
| 355 | |
| 356 | // check runs all checks and user-defined validators on the builder. |
| 357 | func (_u *MachineUpdate) check() error { |
| 358 | if v, ok := _u.mutation.Scenarios(); ok { |
| 359 | if err := machine.ScenariosValidator(v); err != nil { |
| 360 | return &ValidationError{Name: "scenarios", err: fmt.Errorf(`ent: validator failed for field "Machine.scenarios": %w`, err)} |
| 361 | } |
| 362 | } |
| 363 | return nil |
| 364 | } |
| 365 | |
| 366 | func (_u *MachineUpdate) sqlSave(ctx context.Context) (_node int, err error) { |
| 367 | if err := _u.check(); err != nil { |