Re: AR: quoting integer in string : how to fix ?

Tony
2006-09-21T14:01:25Z

eize.sus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> Try using find(:all, :conditions => "rank = ?", intString)

Hi Eize !

Thanks for comming ;)

What is intString ? You mean a string containing an integer like
"1234"
?
If this is what you mean, it does not work either. The find_all_by_rank
generate the same find(:all,...) that you write.

For insert or update, rails use a hash with the fields names and types,
and pass to the quote method the value and the type of the field. But
for select, the field type is not searched. So quote is called only with
the value ... And I could not guess when to return integer and when to
return string.

From now, I change all my find method having integer with a call to
String.to_i and my Adapter always return quoted string. Not really easy
to use at all.

Tony