title: Order array of hashes by name but keep names with same id together
body: <p>I have the following array of hashes:</p>
  
  <pre><code>  [{:name=&gt;"Albert", :id=&gt;"1"},
    {:name=&gt;"Billy", :id=&gt;"3"},
    {:name=&gt;"Carol", :id=&gt;"4"},
    {:name=&gt;"Dennis", :id=&gt;"2"},  
    {:name=&gt;"Ellen", :id=&gt;"1"}, 
    {:name=&gt;"Frank", :id=&gt;"5"},
    {:name=&gt;"Gerald", :id=&gt;"3"}]
  </code></pre>
  
  <p>I need to sort and have the result be:</p>
  
  <pre><code>  [{:name=&gt;"Albert", :id=&gt;"1"},
    {:name=&gt;"Ellen", :id=&gt;"1"},
    {:name=&gt;"Billy", :id=&gt;"3"},
    {:name=&gt;"Gerald", :id=&gt;"3"} 
    {:name=&gt;"Carol", :id=&gt;"4"}, 
    {:name=&gt;"Dennis", :id=&gt;"2"}, 
    {:name=&gt;"Frank", :id=&gt;"5"}]
  </code></pre>
  
  <p>So sort names but group ids together also sorting by name. </p>
  
  <p>I have tried looking at the <code>sort_by</code> method but I don't think it will work in this situation? Any help in the right direction would be appreciated.</p>