
:nullable => false disallows blank strings
Reported by mpd | September 22nd, 2009 @ 10:57 PM
Surprising! I prefer to do this with :length or sometimes :format.
Tiny example at http://github.com/xxx/dm10-no-blank-strings
Comments and changes to this ticket
-
mpd September 22nd, 2009 @ 10:58 PM
- Tag set to 0.10.0, nullable, validation, validations
-
mpd September 25th, 2009 @ 08:10 PM
:allow_nil and :allow_blank sound fine to me. If that's what is coming in the future, this can be closed.
I can handle my particular issue for now with a custom validation.
-
Dan Kubb (dkubb) September 27th, 2009 @ 12:46 AM
- State changed from new to duplicate
Closing this ticket because the solution proposed in #935 should resolve it.
@ashley: I can understand that. I still really appreciate tickets that help improve auto-validations.
While I expect complex apps to be composed of mostly custom validations, I would like to make sure DataMapper's "out of the box" experience is as good as possible, and ideally replace custom validations with more sane auto-validation behavior.
-
Dan Kubb (dkubb) November 10th, 2009 @ 04:00 PM
- State changed from duplicate to resolved
(from [05d6c8f0ee8a0e7426c4b7640cc1865b35d1bb29]) [dm-validations] Add :allow_blank option to validators
- Refactored logic testing allow_nil and allow_blank
- Refactored #call methods for validators to use a private #valid? method when possible, that performs the validator and returns true/false.
[#935] [#1058 state:resolved] http://github.com/datamapper/dm-more/commit/05d6c8f0ee8a0e7426c4b76...
-
Dan Kubb (dkubb) November 10th, 2009 @ 04:00 PM
- Assigned user set to Dan Kubb (dkubb)
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 »
People watching this ticket
Referenced by
-
1048 Tests and (merb) controllers + belongs_to = red Some of them are. Often it's coming up that when I think ...
-
935 Nullable/required in auto-validations [#935] [#1058 state:resolved] http://github.com/datamapp...
-
1058 :nullable => false disallows blank strings [#935] [#1058 state:resolved] http://github.com/datamapp...