Cache about page
This commit is contained in:
parent
2de6ed9bf9
commit
1399736053
|
@ -4,23 +4,25 @@ class AboutController < ApplicationController
|
|||
def index; end
|
||||
|
||||
def about
|
||||
user_count = User
|
||||
.where.not(confirmed_at: nil)
|
||||
.where("answered_count > 0")
|
||||
.count
|
||||
cache "about_counters", expires_in: 1.hour do
|
||||
user_count = User
|
||||
.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_ban_count = UserBan
|
||||
.current
|
||||
.joins(:user)
|
||||
.where.not("users.confirmed_at": nil)
|
||||
.where("users.answered_count > 0")
|
||||
.count
|
||||
|
||||
@users = user_count - current_ban_count
|
||||
@questions = Question.count
|
||||
@answers = Answer.count
|
||||
@comments = Comment.count
|
||||
@smiles = Appendable::Reaction.count
|
||||
@users = user_count - current_ban_count
|
||||
@questions = Question.count(:id)
|
||||
@answers = Answer.count(:id)
|
||||
@comments = Comment.count(:id)
|
||||
@smiles = Appendable::Reaction.count
|
||||
end
|
||||
end
|
||||
|
||||
def privacy_policy; end
|
||||
|
|
Loading…
Reference in New Issue