I am looking for a way to pass an array param to a pg_array query (https://www.postgresql.org/docs/8.2/static/functions-array.html). Something like:
Model.where("array_col && ?", ids)
&& - overlap
ids
= [2,3]
array_col
is array containing integers for example [1,2]
When hardcoded works:
Model.where("array_col && ARRAY[2,3]")
Load the pg_array extension into the Sequel::Database object (it ships with Sequel), then:
Sequel also ships with a pg_array_ops extension, which allows you to do: