ruby-on-railsrubygemsreformtrailblazer

Validation of a set value with Reform


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?


Solution

  • According to reform documentation field can be validated with inclusion:

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