From: Uwe s Schirmer Date: 2008-06-04T21:09:51+09:00 Subject: Re: Mering an array of hashes I would do it like this: a1 = [{:name=>"File1.rar", :id=>"a3d80425a51a3a4cb2d7a3201439ef6cc3af5874"}, {:name=>"File2.avi", :id=>"58a658047ccb7333eb812da02dca9d84c1db2b41"}, {:name=>"File3.avi", :id=>"944f6a7c50a4a5cff0c28cb0f9158b16580b0310"}] a2 = [{:name=>"File2.avi", :other_attributes =>"stuff"}, {:name=>"File1.rar", :other_attributes=>"stuff"}, {:name=>"File3.avi", :other_attributes=>"stuff"}] a3 = Array.new a1.each do |entry1| a2.each do |entry2| if entry1[:name].eql? entry2[:name] a3.push(entry1.merge(entry2)) break end end end p a3 -- Posted via http://www.ruby-forum.com/.