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
Handle length validator with procs, improve validators support (#1859)
Devise changed their password validations to use a proc for
minimum/maximum for additional customization, but that apparently broke
SimpleForm minlength/maxlength logic since it wasn't handling that.
Instead of implementing it custom by checking for the value responding
to `call` like we do for a couple of other validators, I went with the
route of copying over the `resolve_value` implementation added to Rails
7.1 that handles all the possible scenarios for procs / send / etc,
which allows different ways of setting up the proc.
Expand usage of the shared `resolve_value` implementation across
the board, so other validations like numericality and format apply the
same logic to better match Rails behavior.
Closes#1858
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
## Unreleased
2
2
3
3
* Ruby 4.0 support (no changes required)
4
+
* Support procs on validators for minlength/maxlength, and improve validators logic across the board to match Rails [#1859](https://github.com/heartcombo/simple_form/pull/1859)
0 commit comments