Da drückste Plus

This commit is contained in:
nilsding 2014-11-28 22:11:36 +01:00
parent ccc1b47cb3
commit 6ac2e015fd
1 changed files with 2 additions and 2 deletions

View File

@ -9,8 +9,8 @@ namespace :justask do
desc "Recount every user's answer/question count."
task recount: :environment do
total = User.count
progress = ProgressBar.create title: 'Processing user', format: "%t (%c/%C) [%b>%i] %e", starting_at: 1, total: total
User.all do |user|
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
asked = Question.where(user: user).where(author_is_anonymous: false).count