How can I find the object associated with the results of an ActiveRecord Calculation rather than a value?
For example I have @parent which has many children. I would lik
Not sure if this is the most efficient but once you have the maximum value you can pass that along in a hash to get the object
@maxvalue = @parent.children.maximum(:value) @myObject = @parent.children.where(:value => @maxvalue)