This project is archived and is in readonly mode.
validates_length_of should exclude last member of an end-excluding range
-
José Valim
- Tag changed from patch, validates_length_of, validations to bugmash, patch, validates_length_of, validations
-
Adam Keys
The patch above appears to apply to master, unless I'm missing something. I've attached a patch that applies to 2-3-stable and verified it.
-
David Trasbo
+1
Patch is applied cleanly to edge and all tests are passing.
-
José Valim
- State changed from new to incomplete
Using range.min and range.max iterates through the whole collection. The patch should do something like:
min = range.begin max = range.end max -= 1 if range.exclude_end? -
Adam Keys
Reworked patch per Jose's comments.
-
José Valim
- State changed from incomplete to resolved
- Tag changed from bugmash, patch, validates_length_of, validations to patch, validates_length_of, validations
-
Repository
(from [5632b36701ad9514d596c558877cd74c14c1d54b]) Fix exclusive range patch to use begin/end instead of min/max. [#2981 validates_length_of should exclude last member of an end-excluding range status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/5632b36701ad9514d596c558877cd7...
