Hi there, just getting started and wondering where I should deal with virtual attributes. Is there a way to specify some attributes that are used for validation but should not be included in .output
? Thanks!
AFAIK there’s no such behaviour in dry-validation. I think the best thing would be to whitelist/blacklist keys in whatever deals with the validation’s output before passing that data around further.
Hello What’s the source of these attributes? As in, where are they coming from?
Thanks for the quick replies! TLDR I eliminated the virtual attribute, but @timriley I think your approach would have made sense within a dry-transaction.
Basically, I was trying to convert a form object based on the “reform” gem to one using only dry-validation. The attributes were from params from a form submission, and just one of the attributes was being used for validation only (not a database column).