title: How to manipulate hash keys to transform numeric months to names
body: <p>I have an AR query that returns a hash of events per month, ordered by month</p>
  
  <pre><code>o.events.group("to_char(date,'MM')").order("to_char(date,'MM')").size()
  </code></pre>
  
  <p>I'm using numeric months in this query as it was the best way I could find to get things in the correct order, and I also need to do some other manipulations on the hash.</p>
  
  <p>Before display the results, I need to convert the numeric months back to words. I added the following to the end of the query</p>
  
  <pre><code>.each_key{ |key| Date::MONTHNAMES[key] }
  </code></pre>
  
  <p>But i get</p>
  
  <pre><code>TypeError: can't convert String into Integer.
  </code></pre>
  
  <p>So i tried</p>
  
  <pre><code>.each_key{ |key| Date::MONTHNAMES[key.to_i] }
  </code></pre>
  
  <p>But the months remain in numeric form</p>
  
  <pre><code>{"01"=&gt;4, "02"=&gt;3.....
  </code></pre>
  
  <p>How can i manipulate this hash to get</p>
  
  <pre><code>{"January"=&gt;4, "February"=&gt;3.....
  </code></pre>