From a hash like the below one, need to extract the unique values per key
array_of_hashes = [ {\'a\' => 1, \'b\' => 2 , \'c\' => 3} ,
This is more generic:
options = {} distinct_keys = array_of_hashes.map(&:keys).flatten.uniq distinct_keys.each do |k| options[k] = array_of_hashes.map {|o| o[k]}.uniq end