Appease the dog overlords

This commit is contained in:
Karina Kwiatek 2022-07-18 22:27:31 +02:00 committed by Karina Kwiatek
parent 6344b55b44
commit 977ebdfe4d
5 changed files with 13 additions and 13 deletions

View File

@ -5,16 +5,16 @@ class AboutController < ApplicationController
def about
user_count = User
.where.not(confirmed_at: nil)
.where("answered_count > 0")
.count
.where.not(confirmed_at: nil)
.where("answered_count > 0")
.count
current_ban_count = UserBan
.current
.joins(:user)
.where.not("users.confirmed_at": nil)
.where("users.answered_count > 0")
.count
.current
.joins(:user)
.where.not("users.confirmed_at": nil)
.where("users.answered_count > 0")
.count
@users = user_count - current_ban_count
@questions = Question.count

View File

@ -3,7 +3,7 @@
class LinkFilterController < ApplicationController
def index
redirect_to root_path unless params[:url]
@link = params[:url]
end
end

View File

@ -15,7 +15,7 @@ class TimelineController < ApplicationController
end
def list
@list = current_user.lists.find_by_name!(params[:list_name])
@list = current_user.lists.find_by!(name: params[:list_name])
@timeline = @list.cursored_timeline(last_id: params[:last_id])
@timeline_last_id = @timeline.map(&:id).min
@more_data_available = !@list.cursored_timeline(last_id: @timeline_last_id, size: 1).count.zero?

View File

@ -6,12 +6,12 @@ describe AboutController, type: :controller do
describe "#about" do
subject { get :about }
before(:each) {
before(:each) do
FactoryBot.create(:user, { confirmed_at: Time.current, answered_count: 1 })
FactoryBot.create(:user, { confirmed_at: Time.current, answered_count: 1 }).ban
FactoryBot.create(:user, { confirmed_at: Time.current })
FactoryBot.create(:user, { confirmed_at: Time.current }).ban
}
end
it "shows the correct user count" do
subject

View File

@ -22,4 +22,4 @@ describe LinkFilterController, type: :controller do
end
end
end
end
end