I have the following array:
array = [{"a" => 2}, {"b" => 3}, {"a" => nil}, {"c" => 2}, {"b" => nil}]
I want to convert it into 1 big hash but keep all of the values, so I want it to look like the following:
{"a" => [2, nil], "b" => [3, nil], "c" => [2]}
I can get close doing array.inject({}) {|s, h| s.merge(h)}}, but it overwrites the values.
"c"=> [2]in the hash?