Skip to content

Instantly share code, notes, and snippets.

@gmgent
Created April 11, 2012 23:23
Show Gist options
  • Save gmgent/2363441 to your computer and use it in GitHub Desktop.
Save gmgent/2363441 to your computer and use it in GitHub Desktop.
ruby_find_dup_hash_on_key_in_array
puts array_of_hashes.select{|i| array_of_hashes.select{|s|s[:key]==i[:key]}.count > 1}.map {|show| "#{show[:key]} #{show[:name]}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment