Open lessless opened 9 years ago
I think this is beyond what it means to have a "default value", this is really a kind of data validation, which I think is beyond the scope of Virtus. I'm not the maintainer of this project but I'd say you should either just override the setter method or find/build another library to do this kind of thing.
Hello I would like to make a constrain for an attribute, e.g. #role can be either :admin, :manager or :user only, and it must be set to the :user in any other case.