title: Find ActiveRecord object by maximum field value of a child object?
body: <p>How can I find the object associated with the results of an ActiveRecord Calculation rather than a value?</p>
  
  <p>For example I have @parent which has many children. I would like to find the child with the maximum 'value'.</p>
  
  <p>I understand that I can do @parent.children.maximum(:value), but this returns the maximum value. Is there a method similar to maximum and minimum that returns the entire object instead of the value so that I can use different fields from the maximum object?</p>