Hi All,
Is there any way to use ActiveRecord calculations while also acquiring relevant field names? For example, I'd like to find the average age of all people with the various last names. Basically I'd like to use:
Person.average(:age, :group_by => "last_name")
... as a substitute for
"Select last_name, AVG(age) FROM People GROUP BY last_name"
Any ideas?