I would like to find all records from a table where a column value exist
in an array…
like this
@city_array = [‘125’, ‘459’, ‘748’,… ‘9654’, ‘12459’] # can be over
500 id’s
@condition = [‘WHERE city_id IN ?’, @city_array]
@proposals = Proposals.find (:all, :condition => @condition)
if this set of values is small , that’s fine, but when the array size is
big, it can explode the string size limit of the where clause…
or I can loop over the array ids, but so long… performance…
any suggestions ?
thanks
kad