check runs all checks and user-defined validators on the builder.
()
| 853 | |
| 854 | // check runs all checks and user-defined validators on the builder. |
| 855 | func (_u *MachineUpdateOne) check() error { |
| 856 | if v, ok := _u.mutation.Scenarios(); ok { |
| 857 | if err := machine.ScenariosValidator(v); err != nil { |
| 858 | return &ValidationError{Name: "scenarios", err: fmt.Errorf(`ent: validator failed for field "Machine.scenarios": %w`, err)} |
| 859 | } |
| 860 | } |
| 861 | return nil |
| 862 | } |
| 863 | |
| 864 | func (_u *MachineUpdateOne) sqlSave(ctx context.Context) (_node *Machine, err error) { |
| 865 | if err := _u.check(); err != nil { |