From 40f0e87fdcc5a81fe62881667abb8be33394eba1 Mon Sep 17 00:00:00 2001 From: nilsding Date: Sat, 29 Nov 2014 12:21:42 +0100 Subject: [PATCH] fixed justask:recount --- Rakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index def9fc56..90bb6e03 100644 --- a/Rakefile +++ b/Rakefile @@ -12,9 +12,9 @@ namespace :justask do progress = ProgressBar.create title: 'Processing user', format: "%t (%c/%C) [%b>%i] %e", starting_at: 0, total: total User.all.each do |user| begin - answered = Question.where(user: user).count + answered = Answer.where(user: user).count asked = Question.where(user: user).where(author_is_anonymous: false).count - commented = Question.where(user: user).count + commented = Comment.where(user: user).count user.answered_count = answered user.asked_count = asked user.commented_count = commented @@ -43,4 +43,4 @@ namespace :justask do user.save! puts "#{user.screen_name} no longer an admin" end -end \ No newline at end of file +end