There is probably a very simple answer to this question, but I can\'t for the life of me figure it out at the moment. If I have a ruby array of a certain type of objects, an
array.max_by do |element| element.field end
Or:
array.max_by(&:field)