Retrospring/app/controllers/about_controller.rb

33 lines
649 B
Ruby
Raw Normal View History

2022-07-18 07:26:11 -07:00
# frozen_string_literal: true
class AboutController < ApplicationController
def index; end
def about
2023-02-17 06:58:28 -08:00
cache "about_counters", expires_in: 1.hour do
@users = user_count - current_ban_count
@questions = Question.count(:id)
@answers = Answer.count(:id)
@comments = Comment.count(:id)
end
end
def privacy_policy; end
def terms; end
2023-02-18 01:55:35 -08:00
private
def user_count = User
.where.not(confirmed_at: nil)
.where("answered_count > 0")
.count
def current_ban_count = UserBan
.current
.joins(:user)
.where.not("users.confirmed_at": nil)
.where("users.answered_count > 0")
.count
2022-07-18 07:26:11 -07:00
end