Class: Competition::LeaderboardController

Inherits:
ApplicationController show all
Defined in:
app/controllers/competition/leaderboard_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
# File 'app/controllers/competition/leaderboard_controller.rb', line 5

def index
  #TODO: Make this not suck
  @scores = Competition::Score.all.sort {|a, b| b.score_entries.sum(:amount) <=> a.score_entries.sum(:amount)}
end