title: Rail postgres array contains (<@) dont include nil
body: <p>I have a Matchups table that includes a field that is equipment_id and stores an array</p>
  
  <p>I am trying to search the Matchups table to get any records that have an array where it contains specific equipment ids. For example: 
  So I am running:</p>
  
  <pre><code>search_equipment_ids = [1, 2, 3, 4, 5]
  
  Matchup.where("equipment_id &lt;@ ARRAY[?]", search_equipment_ids)
  </code></pre>
  
  <p>The following are a few examples of arrays that are stored in the table in equipment_id and what the above query would result in</p>
  
  <pre><code>[1, 2] = True
  [3, 5] = True
  [1, 2, 3] = True
  [1, 2, nil, 3] = False
  </code></pre>
  
  <p>How can get the search to ignore that there might be a nil included in the array. I am going to make a change to how the array is stored so from here on out there will be no nil values...but in the mean time I need to take these into account.</p>
  
  <p>I am using: <a href="https://www.postgresql.org/docs/9.5/static/functions-array.html" rel="nofollow">https://www.postgresql.org/docs/9.5/static/functions-array.html</a> as a reference. </p>
  
  <p>I dont want to use the &amp;&amp; operator because the Matchups table is huge it will return to many results if just comparing if one equipment id is present. I want to only return if all the equipment_ids are contained (excluding any nils).</p>
  
  <p>Thank you!</p>