title: Rails 3 selecting only values
body: <p>In rails 3, I would like to do the following:</p>
  
  <pre><code>SomeModel.where(:some_connection_id =&gt; anArrayOfIds).select("some_other_connection_id")
  </code></pre>
  
  <p>This works, but i get the following from the DB:</p>
  
  <pre><code>[{"some_other_connection_id":254},{"some_other_connection_id":315}]
  </code></pre>
  
  <p>Now, those id-s are the ones I need, but I am uncapable of making a query that <em>only</em> gives me the ids. I do not want to have to itterate over the resulst, only to get those numbers out. Are there any way for me to do this with something like :</p>
  
  <pre><code>SomeModel.where(:some_connection_id =&gt; anArrayOfIds).select("some_other_connection_id").values()
  </code></pre>
  
  <p>Or something of that nautre?</p>
  
  <p>I have been trying with the ".select_values()" found at <a href="https://github.com/rails/rails/blob/7530c5224c77202d62f44a26ae5036d1dc00f579/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb#L276" rel="nofollow">Git-hub</a>, but it only returns "some_other_connection_id".</p>
  
  <p>I am not an expert in rails, so this info might be helpful also:</p>
  
  <p>The "SomeModel" is a connecting table, for a many-to-many relation in one of my other models. So, accually what I am trying to do is to, from the array of IDs, get all the entries from the other side of the connection. Basicly I have the source ids, and i want to get the data from the models with all the target ids. If there is a magic way of getting these without me having to do all the sql myself (with some help from active record) it would be really nice!</p>
  
  <p>Thanks :)</p>