title: Update a ruby array containing objects
body: <p>If I have an array of objects in ruby, how can I iterate over the array and update the object?</p>
  
  <p>example:
  <code>test_arr</code> has the following value: (fetched by a find_by_sql)</p>
  
  <pre><code>test_arr = [
    {"id"=&gt;1024, "value"=&gt;"9999"},
    {"id"=&gt;1025, "value"=&gt;"9999"} 
  ]
  </code></pre>
  
  <pre><code>test_arr.map{|r| r.value="1111"}
  </code></pre>
  
  <p>returns 
      ["1111", "1111"]</p>
  
  <p>I need something like: (after update)</p>
  
  <pre><code>[{"id"=&gt;1024, "value"=&gt;"1111"}&gt;,
  {"id"=&gt;1025, "value"=&gt;"1111"}&gt;]
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>