title: Rails ActiveRecord find array of ids, but some are not found
body: <p>I am trying to find a model by an array of ids like so:</p>
  
  <pre><code>Model.find [1,2,3]
  </code></pre>
  
  <p>but let's say only two of these models exist (the model with id of 2 was deleted):</p>
  
  <pre><code>#&lt;Model id: 1&gt;
  #&lt;Model id: 3&gt;
  </code></pre>
  
  <p>I get an error like this:</p>
  
  <pre><code>#&lt;ActiveRecord::RecordNotFound: Couldn't find all Models with 'id': (1, 2, 3) (found 2 results, but was looking for 3).&gt;
  </code></pre>
  
  <p>Is it possible to catch this error and determine which of the models were not present?</p>
  
  <p>say i'm in my controller:</p>
  
  <pre><code>def index
    @models = Model.find params.require(:model_ids)
  rescue ActiveRecord::RecordNotFound =&gt; e
    e.full_message
    ???
  end
  </code></pre>
  
  <p>I'd like to, in the <code>???</code> line, run some code on the exception <code>e</code> that will return <code>2</code>, letting me know what of the models was not found, so I can re-run the query without it while noting which ones weren't found.</p>