ontoportal-lirmm / goo

Graph Oriented Objects (GOO) for Ruby. A RDF/SPARQL based ORM.
http://ncbo.github.io/goo/
Other
0 stars 4 forks source link

Feature: Implement instance proc validators #28

Closed syphax-bouazzouni closed 1 year ago

syphax-bouazzouni commented 1 year ago

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 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)

Changes