title: Rails ActiveRelation to hash
body: <p>I need to hashify ActiveRelation! For example
  I have such AR</p>
  
  <pre><code>arel = MyClass.page(options[:page]).per(options[:per]) 
  </code></pre>
  
  <p>Is here a way simple to create hash with primary keys of MyTable as keys in hash</p>
  
  <p>Ex1:</p>
  
  <pre><code>[#&lt;Object id: 44, name: "name44" &gt;, #&lt;Object id: 2, name: "name2" &gt;, #&lt;Object id: 110, name: "name110"&gt;]
  =&gt;
  {44=&gt;"name44", 2=&gt;"name2",110=&gt;"name110"}
  </code></pre>
  
  <p>Ex2:</p>
  
  <pre><code>[#&lt;Object id: 44, name: "name44" &gt;, #&lt;Object id: 2, name: "name2" &gt;, #&lt;Object id: 110, name: "name110"&gt;]
  =&gt;
  {44=&gt;{:id=&gt;44, :name=&gt;"name44", 2=&gt;{:id=&gt;2,:name=&gt;"name2"},110=&gt;{:id=&gt;110,:name=&gt;"name110"}}
  </code></pre>