From 52dabec9447b17a72fb0815e87c8b4f4b5a056f8 Mon Sep 17 00:00:00 2001 From: Hugo Melo Date: Thu, 22 Oct 2015 22:37:55 -0200 Subject: [PATCH] Add missing column on export_ranking --- script/export_ranking.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/script/export_ranking.rb b/script/export_ranking.rb index 2a8a6a1..951b62a 100644 --- a/script/export_ranking.rb +++ b/script/export_ranking.rb @@ -39,10 +39,10 @@ profile_ids.each do |profile_id| person_followers = (person.following_articles & person.article_followers.where(article_id: person_articles)).count else person_articles = profile.articles.where(:author_id => person.id) - person_up_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote > 0').count + person_articles.joins(:votes).where('vote > 0').count - person_down_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote < 0').count + person_articles.joins(:votes).where('vote < 0').count - person_comments = person.comments.where(:source_id => profile.articles).count - person_followers = (person.following_articles & person.article_followers.where(article_id: profile.articles)).count + person_up_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote > 0').count + person_articles.joins(:votes).where('vote > 0').count + person_down_votes = person.comments.where(:source_id => profile.articles).joins(:votes).where('vote < 0').count + person_articles.joins(:votes).where('vote < 0').count + person_comments = person.comments.where(:source_id => profile.articles).count + person_followers = (person.following_articles & person.article_followers.where(article_id: profile.articles)).count end quantities_values = [ Vote.for_voter(person).count, @@ -50,6 +50,7 @@ profile_ids.each do |profile_id| person_up_votes, person_down_votes, person_articles.count, + person_comments, Comment.where(:source_id => person_articles).count, person_followers, ArticleFollower.where(:article_id => person_articles).count -- libgit2 0.21.2