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 currently using Vex.Struct to build form models in my Phoenix application. The library is extremely useful, thanks for releasing it. One thing I'd like to do is dependent validations, i.e. validations that depend on some other field in the struct. Currently this is not possible as Vex passes only the value of the field under test into the validate function. It would be cool if it worked in a similar way ActiveModel::EachValidator in Rails, i.e. the validation receives the entire struct as context as well as the value under test. This would also have the benefit of enabling the confirmation validator without Vex.extract/3 treating it as a special case.
I intend to contribute a patch myself, but first I want to get your thoughts on the best approach, backwards compatibility considerations re the existing Vex.Validator.Behaviour, etc.
What do you think?
The text was updated successfully, but these errors were encountered:
I'm currently using
Vex.Struct
to build form models in my Phoenix application. The library is extremely useful, thanks for releasing it. One thing I'd like to do is dependent validations, i.e. validations that depend on some other field in the struct. Currently this is not possible as Vex passes only the value of the field under test into the validate function. It would be cool if it worked in a similar wayActiveModel::EachValidator
in Rails, i.e. the validation receives the entire struct as context as well as the value under test. This would also have the benefit of enabling the confirmation validator withoutVex.extract/3
treating it as a special case.I intend to contribute a patch myself, but first I want to get your thoughts on the best approach, backwards compatibility considerations re the existing
Vex.Validator.Behaviour
, etc.What do you think?
The text was updated successfully, but these errors were encountered: