Appease the dog overlords
This commit is contained in:
parent
6344b55b44
commit
977ebdfe4d
|
@ -5,16 +5,16 @@ class AboutController < ApplicationController
|
||||||
|
|
||||||
def about
|
def about
|
||||||
user_count = User
|
user_count = User
|
||||||
.where.not(confirmed_at: nil)
|
.where.not(confirmed_at: nil)
|
||||||
.where("answered_count > 0")
|
.where("answered_count > 0")
|
||||||
.count
|
.count
|
||||||
|
|
||||||
current_ban_count = UserBan
|
current_ban_count = UserBan
|
||||||
.current
|
.current
|
||||||
.joins(:user)
|
.joins(:user)
|
||||||
.where.not("users.confirmed_at": nil)
|
.where.not("users.confirmed_at": nil)
|
||||||
.where("users.answered_count > 0")
|
.where("users.answered_count > 0")
|
||||||
.count
|
.count
|
||||||
|
|
||||||
@users = user_count - current_ban_count
|
@users = user_count - current_ban_count
|
||||||
@questions = Question.count
|
@questions = Question.count
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class LinkFilterController < ApplicationController
|
class LinkFilterController < ApplicationController
|
||||||
def index
|
def index
|
||||||
redirect_to root_path unless params[:url]
|
redirect_to root_path unless params[:url]
|
||||||
|
|
||||||
@link = params[:url]
|
@link = params[:url]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,7 @@ class TimelineController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def list
|
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 = @list.cursored_timeline(last_id: params[:last_id])
|
||||||
@timeline_last_id = @timeline.map(&:id).min
|
@timeline_last_id = @timeline.map(&:id).min
|
||||||
@more_data_available = !@list.cursored_timeline(last_id: @timeline_last_id, size: 1).count.zero?
|
@more_data_available = !@list.cursored_timeline(last_id: @timeline_last_id, size: 1).count.zero?
|
||||||
|
|
|
@ -6,12 +6,12 @@ describe AboutController, type: :controller do
|
||||||
describe "#about" do
|
describe "#about" do
|
||||||
subject { get :about }
|
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 })
|
||||||
FactoryBot.create(:user, { confirmed_at: Time.current, answered_count: 1 }).ban
|
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 })
|
||||||
FactoryBot.create(:user, { confirmed_at: Time.current }).ban
|
FactoryBot.create(:user, { confirmed_at: Time.current }).ban
|
||||||
}
|
end
|
||||||
|
|
||||||
it "shows the correct user count" do
|
it "shows the correct user count" do
|
||||||
subject
|
subject
|
||||||
|
|
|
@ -22,4 +22,4 @@ describe LinkFilterController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue