Skip to content
Snippets Groups Projects
Commit d9da61dd authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

More cleanup

parent ade933cb
Branches
Tags
No related merge requests found
......@@ -159,9 +159,9 @@ class ApplicationController < ActionController::Base
@hot_questions = Rails.cache.fetch("#{RequestContext.community_id}/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..Time.now)
.where(post_type_id: Question.post_type_id)
.where(category: Category.where(use_for_hot_posts: true))
.where('score > ?', SiteSetting['HotPostsScoreThreshold'])
.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'])
.order('score DESC').limit(SiteSetting['HotQuestionsCount']).all
end
end
......
......@@ -64,7 +64,7 @@ class PinnedLinksController < ApplicationController
def pinned_link_params
if current_user.is_global_moderator
params.require(:pinned_link).permit(:label, :link, :post, :active, :shown_before, :shown_after, :community)
params.require(:pinned_link).permit(:label, :link, :post, :active, :shown_before, :shown_after, :community_id)
else
params.require(:pinned_link).permit(:label, :link, :post, :active, :shown_before, :shown_after)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment