Validation of a set value with Reform

643 Views Asked by At

On attempting to extract the validation, I'm trying to use a Object Form, so, I found reform.

But I have a model with enum type. How can I validate this value on Reform?

1

There are 1 best solutions below

0
On BEST ANSWER

According to reform documentation field can be validated with inclusion:

validates :status, inclusion: { in: %w(open closed) }