You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a big fan of using dry-validation contracts in TRB operations.
A cool, but too little advertised feature of a Dry::Validation::Result is it's output method, which returns only validated (and type-coerced) data. This makes it perfect for "forcing" a operation to only use safe data:
So basically, you want to (re-)assign an attribute with an arbitrary value. This is already possible in 2.1 by using an :output filter, but it's a cool idea to add this step automatically to Validate(). 🍻
I'm a big fan of using dry-validation contracts in TRB operations.
A cool, but too little advertised feature of a
Dry::Validation::Result
is it'soutput
method, which returns only validated (and type-coerced) data. This makes it perfect for "forcing" a operation to only use safe data:(Full Sample)
It would be great, if the
Validate
macro could take some option to get rid of the second step. Maybe something like theNested
macro:The text was updated successfully, but these errors were encountered: