title: Postgresql jsonb (Rails) - query multiple values, via an array, in a single json attribute
body: <p>In Rails I can do <code>.where(:attr =&gt; [val1, val2, val3])</code> and I'll get back all the rows matching any of those <code>val1-3</code>.</p>
  
  <p>I'm using Postgres/Postgresql and have a jsonb type and I'd like to do a similar thing. PsuedoCode: <code>.where("col @&gt; ?", {attr: [val1, val2, val3]}.to_json)</code>, but this returns nothing - bc it's trying to find a value of the entire array <code>[val1, val2, val3 ]</code> not  each of the individual values: <code>val1</code>, <code>val2</code>, <code>val3</code>? </p>
  
  <p>Is there any way to pass in multiple values, relative to as single attribute, in a jsonb query?</p>
  
  <p>I could do <code>.where("attr @&gt; {.. val1 ...} OR attr @&gt; {... val2 ..} ...")</code>, but it seems like there would be a better way.</p>
  
  <p>I've tried various things from <a href="https://www.postgresql.org/docs/9.4/static/functions-json.html" rel="nofollow">https://www.postgresql.org/docs/9.4/static/functions-json.html</a>, but seem to have a solution evading me.</p>