#1097 ✓duplicate

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

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket