Count users that only answer questions as active

This commit is contained in:
Andreas Nedbal 2022-04-17 17:41:10 +02:00 committed by Andreas Nedbal
parent c1cf9bab3f
commit a768d09862
2 changed files with 1 additions and 2 deletions

View File

@ -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

View File

@ -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 })