Closed FunkyloverOne closed 6 years ago
I guess that operations must be reused only inside Transactions, which should already include some other validate
step, which will make sure that operation will get valid input.
E.g. I must assume that operations will be always receiving only valid input.
BTW, should I use dry-validation for that validate
step? (I guess yes, of course :D)
OK, I'm closing this issue, seems like I've already answered my question, and now I know that you guys are having forums for stuff like that :+1:
If I want to validate some separate operation input... First of all, should I actually do it? :) If so, then, I guess it would be consistent to use so dry-validation schema for it.
So if it is only a validation for this particular operation, maybe it's right place to define it directly inside operation class, and than use it in some private method called
validate_input
for example, and call is at the beginning ofcall
method... But i'm not sure it is "legit".I'm only starting learning dry-rb, so I'm trying to better understand how it meant to be used. BTW, maybe it would be good to have some sort of FAQ for questions like this.