Answers for "rails merge arrays of hash"

3

ruby merge array of hashes into one hash

a.reduce Hash.new, :merge
Posted by: Guest on July-31-2020
2

ruby merge array of hashes into one hash

a.inject(:merge)
#=> {:a=>:b, :c=>:d}
Posted by: Guest on July-31-2020

Browse Popular Code Answers by Language