title: Ruby On Rails 5, activerecord query where model association ids includes ALL ids in array
body: <p>I have a Has many belongs to association for Recipes and Ingredients.</p>
  
  <p>I am trying to return recipes which have all the ingredient ids in a given array of integers. 
  Eg. I search using multiple ingredients, and I want to return any Recipe that has all the ingredients. If too many ingredients are given, but the Recipe includes them all, it should also return the recipe.</p>
  
  <p>I have tried a few things, </p>
  
  <pre><code>Recipe.joins(:ingredients).where(ingredients: { id: ids })
  </code></pre>
  
  <p>which returns the Recipes that have ANY of the ingredients</p>
  
  <pre><code>Recipe.joins(:ingredients).where('ingredients.id LIKE ALL ( array[?])', ids)
  </code></pre>
  
  <p>This gives an error: <code>ERROR: operator does not exist: integer ~~ integer</code></p>
  
  <p>How can I find only the recipes that include all of the ids given in the array?</p>