We've got a situation where we're setting up params[:blah]
in a form.  When the form is submitted, we do a
Model.find(:first, :conditions => params[:blah])

This generates a SELECT with all the params, but the
problem is that if the user left some fields blank,
the WHERE conditions end up looking like

 WHERE some_field = ''

which is accepted by mysql, but fails on certain field
types (e.g. Integer) in postgres.  What we really want
in most cases would be no specified condition at all
corresponding to blank fields, or perhaps flag an error.

Is there anything already in rails that I might be missing
that exists to deal with this situation?

Thanks...

                -glenn
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to