For example, if a model defines an instance method called equal_to_10 that tests if a value is equal to 10.
Then we can reference it as a validator for an attribute, like so attribute :age, enforce: [:equal_to_10], this will enforce the attribute age to be 10 (as implemented in the method equal_to_10)
Context
see https://github.com/agroportal/project-management/issues/393
What
Now we can call, model-specific validators.
For example, if a model defines an instance method called
equal_to_10
that tests if a value is equal to10
.Then we can reference it as a validator for an attribute, like so
attribute :age, enforce: [:equal_to_10]
, this will enforce the attributeage
to be10
(as implemented in the methodequal_to_10
)Changes