title: ruby rails - getting a collection of objects from a collection of foreign keys
body: <p>Easy one i think/hope... I have a query that returns a list of 20 unique foreign keys:</p>
  
  <pre><code>@results   = Report.select("distinct user_id").where("datetime_utc &gt;= ? AND datetime_utc &lt;= ?",@utc_time_slot , @utc_time_slot_end).order("score DESC, quality DESC").limit(20)  
  </code></pre>
  
  <p>this returns an array (ActiveRecord::Relation class):</p>
  
  <pre><code>[#&lt;Report user_id: 803&gt;, #&lt;Report user_id: 809&gt;, #&lt;Report user_id: 806&gt;, #&lt;Report user_id: 801&gt;, #&lt;Report user_id: 830&gt;, #&lt;Report user_id: 860&gt;, #&lt;Report user_id: 858&gt;, #&lt;Report user_id: 856&gt;, #&lt;Report user_id: 854&gt;, #&lt;Report user_id: 852&gt;, #&lt;Report user_id: 851&gt;, #&lt;Report user_id: 850&gt;, #&lt;Report user_id: 849&gt;, #&lt;Report user_id: 846&gt;, #&lt;Report user_id: 859&gt;, #&lt;Report user_id: 866&gt;, #&lt;Report user_id: 2022&gt;, #&lt;Report user_id: 863&gt;, #&lt;Report user_id: 862&gt;, #&lt;Report user_id: 838&gt;]
  </code></pre>
  
  <p>What do i need to do with this @results array to extract the collection of users form the users table that the user_id list refers to (in the same order)?</p>
  
  <p>Thanks!</p>