Skip to content

Commit

Permalink
change to standard competition ranking algorithm so, eg., 3 committer…
Browse files Browse the repository at this point in the history
…s with 10, 10, and 6 commits respectively will be ranked as 1, 1, 3 instead of 1, 1, 2
  • Loading branch information
paulbaumgart committed Apr 10, 2010
1 parent 5c37116 commit dc7a321
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/repo.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,15 @@ def assign_contributors(contributor_names_per_commit)
# Once all tables have been update we compute the rank of each contributor.
def update_ranks
rank = 0
nsame_rank = 1
ncon = nil
Contributor.all_with_ncontributions.each do |contributor|
if contributor.ncontributions != ncon
rank += 1
rank += nsame_rank
nsame_rank = 1
ncon = contributor.ncontributions
else
nsame_rank += 1
end
contributor.update_attribute(:rank, rank) if contributor.rank != rank
end
Expand Down

0 comments on commit dc7a321

Please sign in to comment.