Commit 9570ae12efaab9047a71e1634697018b42a27401
Exists in
master
and in
1 other branch
Merge branch 'master' of gitlab.com:noosfero-plugins/gamification
Showing
1 changed file
with
5 additions
and
4 deletions
Show diff stats
script/export_ranking.rb
... | ... | @@ -39,10 +39,10 @@ profile_ids.each do |profile_id| |
39 | 39 | person_followers = (person.following_articles & person.article_followers.where(article_id: person_articles)).count |
40 | 40 | else |
41 | 41 | person_articles = profile.articles.where(:author_id => person.id) |
42 | - person_up_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote > 0').count + person_articles.joins(:votes).where('vote > 0').count | |
43 | - person_down_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote < 0').count + person_articles.joins(:votes).where('vote < 0').count | |
44 | - person_comments = person.comments.where(:source_id => profile.articles).count | |
45 | - person_followers = (person.following_articles & person.article_followers.where(article_id: profile.articles)).count | |
42 | + person_up_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote > 0').count + person_articles.joins(:votes).where('vote > 0').count | |
43 | + person_down_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote < 0').count + person_articles.joins(:votes).where('vote < 0').count | |
44 | + person_comments = person.comments.where(:source_id => profile.articles).count | |
45 | + person_followers = (person.following_articles & person.article_followers.where(article_id: profile.articles)).count | |
46 | 46 | end |
47 | 47 | quantities_values = [ |
48 | 48 | Vote.for_voter(person).count, |
... | ... | @@ -50,6 +50,7 @@ profile_ids.each do |profile_id| |
50 | 50 | person_up_votes, |
51 | 51 | person_down_votes, |
52 | 52 | person_articles.count, |
53 | + person_comments, | |
53 | 54 | Comment.where(:source_id => person_articles).count, |
54 | 55 | person_followers, |
55 | 56 | ArticleFollower.where(:article_id => person_articles).count | ... | ... |