What\'s the most elegant way to select out objects in an array that are unique with respect to one or more attributes?
These objects are stored in ActiveRecord so us
ActiveSupport implementation:
def uniq_by hash, array = {}, [] each { |i| hash[yield(i)] ||= (array << i) } array end