通过 Reform 验证设定值

Validation of a set value with Reform

在尝试提取验证时,我尝试使用对象形式,因此,我发现 reform

但是我有一个 enum 类型的模型。我如何在 Reform 上验证这个值?

根据 reform documentation 字段可以通过包含进行验证:

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