title: How to pluck multiple attributes in Rails 3.x?
body: <p>I have an ActiveRecord model like this:</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
    attr_accessible :name
  end
  </code></pre>
  
  <p>and need to get a hash mapping <code>Person</code>'s <code>id</code>s to their <code>name</code>s:</p>
  
  <pre><code>{1 =&gt; "Paul", 2 =&gt; "Aliyah", 3 =&gt; ... }
  </code></pre>
  
  <p>Now, the obvious way would be</p>
  
  <pre><code>Person.all.collect { |p| [p.id, p.name] }.to_h
  </code></pre>
  
  <p>However, I don't need to instantiate every <code>Person</code>, I just need the hash. In Rails 4, I can <code>.pluck(:id, :name)</code> instead of <code>collect</code>, however in 3.x, <code>pluck</code> takes only one argument. However I found this workaround to get what I want without loading the models:</p>
  
  <pre><code>Person.all.group(:id).minimum(:name)
  </code></pre>
  
  <p><strong>Question:</strong> will I burn in hell? Also, is there a more elegant way to do this, and are there any drawbacks of this hacky approach that I may not be aware of? Thanks!</p>