Using rails average method