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