I have an array of hashes, and I want the unique values out of it. Calling Array.uniq doesn\'t give me what I expect.
Array.uniq
a = [{:a => 1},{:a =&g
You can use (tested in ruby 1.9.3),
[{a: 1},{a: 2},{a:1}].uniq => [{a:1},{a: 2}] [{a: 1,b: 2},{a: 2, b: 2},{a: 1, b: 3}].uniq_by {|v| v[:a]} => [{a: 1,b: 2},{a: 2, b: 2}]