I think You want to test all values with ILIKE
function.
This is how it’s done in Postgres:
select * from table where value ilike any (array['%foo%', '%bar%', '%baz%']);
Try to convert to Rails/Ruby syntax like this:
myarray_with_percetage_signs = ["name1","name2"].map {|val| "%#{val}%" }
Product.where("name ILIKE ANY ( array[?] )", myarray_with_percetage_signs)