Model enum validation rules work properly
What I did
- Tweaked generated validation rules to correctly parse enum fields
Implications
Validation on ENUM
fields will work properly using model API's.
Setup
None
Testing
- Use a v2 model with an API (e.g.,
contact_model
and/api/v1/contact/messages
) - Add an
ENUM
field to the model (E.g.,'test' => 'enum("one","two") NOT NULL DEFAULT "one"'
) - Try
POST
ing a record to the API. - When the
test
field is set to something other than one of the enum options, you should get a validation error. - When the
test
field is set to one of the enum options, the save should succeed (all else being valid).