Closed tadeusz-niemiec closed 4 years ago
@tadeusz-niemiec great catch! thank you ❤️
@tadeusz-niemiec ...oops, it actually broke a lot of stuff in dry-schema so I'm afraid we can't fix it like that. I had to revert this :(
@solnic this one fixes failing tests in the dry-schema: https://github.com/dry-rb/dry-schema/pull/291
Fixes dry-rb/dry-schema#290
This resolves the issue with inconsistency in the names of interpolated arguments when using translations for dry-schema/dry-validation messages. Now every interpolated argument is called "num" in all "size" connected validations: "size?", "min_size?", "max_size?".
This was happening because dry-schema calls
predicate.parameters
and uses them to get names of interpolated args in error messagesBtw wasn't sure if this should be "num" or "size". I chose "num" because it will be backward compatible but on the other hand it's less obvious...