I have a table called LayerProducts that contains layer_id and product_id attributes.
I would like to create a query where I can pass in an array of arrays that looks like this:
[ [:layer1_id, :product1_id], [:layer2_id, :product2_id], [:layer3_id, :product3_id] ] and return all records of LayerProduct that contain any of the combinations supplied.
The parent array is not fixed-length, so the query would need to be dynamic to accommodate any number of combinations.
Is this possible and if so, how would I go about creating this query using either SQL or active record?