Skip to content
Snippets Groups Projects
Commit 76561f04 authored by Taico Aerts's avatar Taico Aerts
Browse files

Also hide locked posts

parent 669dccea
No related branches found
No related tags found
1 merge request!27Update to latest version of QPixel
......@@ -269,6 +269,7 @@ 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(closed: false)
.where(locked: 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 })
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment