diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 68cd945fbe804a805dde618a63eba9e8d2c80fcb..8b3211ce7b7b323559c216a7e97ce520696defe5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -268,7 +268,8 @@ class ApplicationController < ActionController::Base @hot_questions = Rails.cache.fetch('hot_questions', expires_in: 4.hours) do Rack::MiniProfiler.step 'hot_questions: cache miss' do - Post.undeleted.where(last_activity: (Rails.env.development? ? 365 : 7).days.ago..DateTime.now) + Post.undeleted.where(closed: false) + .where(last_activity: (Rails.env.development? ? 365 : 7).days.ago..DateTime.now) .where(post_type_id: [Question.post_type_id, Article.post_type_id]) .joins(:category).where(categories: { use_for_hot_posts: true }) .where('score >= ?', SiteSetting['HotPostsScoreThreshold'])