Hi. Is there a way to create anonymous rules in dry-validations? Or do i have to specify them as:
I'm not saying this should be a feature, just curious if it exists. I have a case where I'm validating something but do not at all care about the error messages, only whether or not the thing is valid. I also use
mutant in CI and it complains that it can rename the argument
name__mutant__. I can expose the schema and expect something about it to kill the mutant, but if there already happens to be a way to define the rule anonymously, that'd be cool.
bin one schema and something that validates
cin another and right now I duplicate the logic for
b. In this case the common attributes are top level, not reused objects like you can nest schemas for (as suggested here http://dry-rb.org/gems/dry-validation/reusing-schemas/).
ain two schemas, you’d like to
Well, mainly looking to understand all the reuse options available because i only know what's in that docs page^
In this case i basically want the equivalence of inheritance and I was unsure if you could do something like that.
c just represent different keys I want to validate. If object A has the
b attributes and object B has A's attributes plus a new one,
c, I'd like to be able to reuse my
dayattributes in multiple places i might like to mixin the
dateschema i've built.
daythough it's likely they'd be in a separate object and i could use the reuse mechanism from the docs
Dry::Validation.Schema(Dry::Validation::Schema, rules: SomeSchema.class.rules + OtherSchema.class.rules)