Okay, this should be easy, but it isn’t, although I reserve the right
smack myself upside the head if it is:
Assume that a smart has_many ratings, and a rating belongs_to a smart
models are fine). Each rating has a column smart_id.
Each smart, then, has many ratings, with a column called “rating” that
an int (1-10).
I want to find, say, the ten smarts with the highest average rating.
Calculating an average is easy enough–once I know which smart I’m
at. But how do I find this on the fly?
Anyone? Anyone? Bueller? Bueller?