ValidateValue implements [Field.ValidateValue] interface method.
(ctx context.Context, app App, record *Record)
| 107 | |
| 108 | // ValidateValue implements [Field.ValidateValue] interface method. |
| 109 | func (f *BoolField) ValidateValue(ctx context.Context, app App, record *Record) error { |
| 110 | v, ok := record.GetRaw(f.Name).(bool) |
| 111 | if !ok { |
| 112 | return validators.ErrUnsupportedValueType |
| 113 | } |
| 114 | |
| 115 | if f.Required { |
| 116 | return validation.Required.Validate(v) |
| 117 | } |
| 118 | |
| 119 | return nil |
| 120 | } |
| 121 | |
| 122 | // ValidateSettings implements [Field.ValidateSettings] interface method. |
| 123 | func (f *BoolField) ValidateSettings(ctx context.Context, app App, collection *Collection) error { |