Created
August 10, 2010 10:31
-
-
Save sprite2005/517059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@top_tipper_ids = Tip.find_by_sql("SELECT SUM(tips.amount_cents) total_tip, tips.client_id FROM tips WHERE tips.vendor_id = #{@user.id} GROUP BY tips.client_id ORDER BY total_tip").collect {|e| e.client_id} | |
@top_tippers = User.find_all_by_id(@top_tipper_ids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment