ruby on rails - Finding the union of multiple LIKE searches with searchlogic or named_scopes? -
given delimited string of unknown length e.g. 'peanut,banana'
or 'bacon,eggs,toast,arugula'
, want use named_scope or searchlogic in rails 2.3.9 app end sql statement select * foods (name 'peanut') or (name 'banana')
. ideas?
food.name_like_any("peanut", "banana") # accepts array food.name_like_any(["bacon", "eggs", "toast", "arugula"])
from searchlogic readme
Comments
Post a Comment