From a768d09862d327f19577e0b82ca4724627593d43 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 17 Apr 2022 17:41:10 +0200 Subject: [PATCH] Count users that only answer questions as active --- app/controllers/static_controller.rb | 1 - spec/controllers/static_controller_spec.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index 3d45edfa..6ca9c5e5 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -22,7 +22,6 @@ class StaticController < ApplicationController .where(permanently_banned: false) .where(banned_until: nil) .where('answered_count > 0') - .where('asked_count > 0') .count @questions = Question.count diff --git a/spec/controllers/static_controller_spec.rb b/spec/controllers/static_controller_spec.rb index e7d7036e..3c0003ca 100644 --- a/spec/controllers/static_controller_spec.rb +++ b/spec/controllers/static_controller_spec.rb @@ -7,7 +7,7 @@ describe StaticController, type: :controller do subject { get :about } before(:each) { - FactoryBot.create(:user, { confirmed_at: Time.now, answered_count: 1, asked_count: 1 }) + FactoryBot.create(:user, { confirmed_at: Time.now, answered_count: 1 }) FactoryBot.create(:user, { permanently_banned: true }) FactoryBot.create(:user, { banned_until: Time.now + 10.days }) FactoryBot.create(:user, { confirmed_at: Time.now })