From 7ed01ae95bc3adf33723ecd984cf19be03ab34a3 Mon Sep 17 00:00:00 2001 From: Hugo Melo Date: Thu, 22 Oct 2015 12:16:00 -0200 Subject: [PATCH] Remove filter by text_articles --- script/export_ranking.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/export_ranking.rb b/script/export_ranking.rb index 974217d..554f066 100644 --- a/script/export_ranking.rb +++ b/script/export_ranking.rb @@ -11,6 +11,7 @@ profile_ids.each do |profile_id| profile_name = profile.name end + next if profile_name != 'Conferencia' puts "Creating spreadsheet for #{profile_name}" CSV.open( "ranking_gamification_for_#{profile_name}.csv", 'w' ) do |csv| @@ -37,13 +38,14 @@ profile_ids.each do |profile_id| person.friends.count, person.comments.where(:source_id => person_articles).joins(:votes).where('vote > 0').count + person_articles.joins(:votes).where('vote > 0').count, person.comments.where(:source_id => person_articles).joins(:votes).where('vote < 0').count + person_articles.joins(:votes).where('vote < 0').count, - person_articles.text_articles.count, + person_articles.count, person.comments.where(source_id: person_articles).count, Comment.where(:source_id => person_articles).count, (person.following_articles & person.article_followers.where(article_id: person_articles)).count, ArticleFollower.where(:article_id => person_articles).count ] csv << [person.identifier, person.name, person.points] + categories_values + quantities_values + break if count > 200 end end end -- libgit2 0.21.2