:allow_nil validation vs. blank?

Mike
2007-11-20T19:45:37Z

I think I must be doing something wrong... when a form returns params
to the controller, empty fields appear to be returned as blank, not
nil.  so what''s the point of an :allow_nil=>true setting on a
validation? it fails because blank is not the same as nil.

i would expect either returned empty fields to be nil, or :allow_nil
to really be :allow_blank.  otherwise i have to do a search through
params every time i do a create/update to convert blank to nil.
totally unrailslike.  someone straighten me out please...

thx - mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---