Andrew,

I think the problem is that there is no way to distinguish between a nil
value and a blank value coming from the request. They both look the same and
they both have their uses. I don't think your solution solves this problem,
because there are likely cases like above where blank has significance.

Allen Madsen
http://www.allenmadsen.com


On Tue, Dec 29, 2009 at 1:27 AM, Andrew White <[email protected]> wrote:

> On 28 Dec 2009, at 18:04, Josh Susser wrote:
>
> > That's reasonably concise, but just keep in mind that all of this is
> > just to make Ruby act more like Perl where empty strings are false-ish
> > values.  I'm sure there are other use cases for #presence, but empty
> > strings that come from form submissions seem like at least 90% of the
> > issue.
>
> Maybe we could eliminate that use case by nullifying blank strings where
> appropriate:
>
>  http://github.com/pixeltrix/nullify_blanks
>
> The empty strings in my databases always bugged me so I wrote the above
> plugin to fix that. It only nullifies a blank string where a column exists,
> is a text column and accepts nulls.
>
>
> Andrew
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-core%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.


Reply via email to