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
Reform/ Dry integration takes the whole Dry::Validation::Result#messages (hints + errors), not just errors. Consequently hints are presented indistinguishable from actual errors. If you have two predicates which validate the same nature of an input (e.g. less than + greater than on an int) this leads to a bad user experience - users are told something is failing when it is not.
@apotonick if you look back at the old code I put together for 2.3.1 I had a handle for this.
We have to be careful how we do it as if you run separate calls to dry-v's error messages object (say to get errors and hints separately) it'll build the errors twice.
Complete Description of Issue
Reform/ Dry integration takes the whole Dry::Validation::Result#messages (hints + errors), not just errors. Consequently hints are presented indistinguishable from actual errors. If you have two predicates which validate the same nature of an input (e.g. less than + greater than on an int) this leads to a bad user experience - users are told something is failing when it is not.
Steps to reproduce
Expected behavior
Tell us what should happen
# result.errors is {:age=>["must be greater than 18"]}
Actual behavior
Tell us what happens instead
# result.errors is {:age=>["must be greater than 18", "must be less than 70"]}
System configuration
Reform version:2.2.4
Full Backtrace of Exception (if any)
N/A
The text was updated successfully, but these errors were encountered: