
Auto-validations not testing for blank strings correctly
Reported by DaNCeR | October 18th, 2009 @ 11:36 AM | in 0.10.2
I've noticed what appears to be an issue with length auto-validations on strings. When the minimum of the range is greater then zero the model still validates when the field is set to nil or an empty string. I have attached a demonstration of this behaviour.
Now I'm sure that the expected behaviour for an empty string in this situation is to not pass validation. I am however unsure what is expected when the field is nil. Based on the documentation on the DataMapper website (http://datamapper.org/docs/validations.html) I would assume that it should also fail validation. I have also noticed in ticket #935 they're is discussion in regards to these validations however it is my understanding that this ticket is only dealing with the ambiguity of :nullable and is not referring to any incorrect validations.
For reference the attached script has been run on edge dm as of 19/10.
Comments and changes to this ticket
-
-
DaNCeR October 18th, 2009 @ 11:14 PM
If the reason for this is because of the allow_nil property then so be it. I don't believe that should be the expected behaviour but if it is then the bug is in the documentation.
-
Dan Kubb (dkubb) November 6th, 2009 @ 01:52 AM
- State changed from new to accepted
- Assigned user set to Dan Kubb (dkubb)
-
Dan Kubb (dkubb) November 10th, 2009 @ 03:39 AM
- State changed from accepted to duplicate
- Milestone set to 0.10.2
Work in progressing on this in #935. Marking this as duplicate.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »