Skip to content

Commit

Permalink
Removed zkim from top contributors eligability.
Browse files Browse the repository at this point in the history
  • Loading branch information
zk committed Oct 24, 2010
1 parent db494e4 commit 4f47ce2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/controllers/main_controller.rb
Expand Up @@ -11,8 +11,8 @@ def index
@recently_updated = find_recently_updated(7, nil)
@top_contributors = []

tc_example_versions = Example.find_by_sql("select count(*), example_versions.user_id from example_versions group by user_id order by count(*) desc")[0, num_tc]
tc_examples = Example.find_by_sql("select count(*), examples.user_id from examples group by user_id order by count(*) desc;")[0, num_tc]
tc_example_versions = Example.find_by_sql("select count(*), example_versions.user_id from example_versions group by user_id order by count(*) desc")[0, num_tc+1]
tc_examples = Example.find_by_sql("select count(*), examples.user_id from examples group by user_id order by count(*) desc;")[0, num_tc+1]

tc_examples.each do |e|
count = e["count(*)"]
Expand All @@ -23,8 +23,12 @@ def index
end

user = User.find(e.user_id)
@top_contributors << {:author => user.login, :email => user.email, :score => count}
if not user.id == 1
@top_contributors << {:author => user.login, :email => user.email, :score => count}
end
end

@top_contributors = @top_contributors[0, num_tc]

end

Expand Down

0 comments on commit 4f47ce2

Please sign in to comment.