I have an array of hashes, something like
[ {:type=>\"Meat\", :name=>\"one\"}, {:type=>\"Meat\", :name=>\"two\"}, {:type=>\"Fruit\", :n
Using ActiveSuport's Hash#transform_values:
array.group_by{ |h| h[:type] }.transform_values{ |hs| hs.map{ |h| h[:name] } } #=> {"Meat"=>["one", "two"], "Fruit"=>["four"]}