mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
PERF: N+1 when generating not found page.
This commit is contained in:
parent
d36d5ba8ac
commit
373fd8990e
@ -592,7 +592,7 @@ class ApplicationController < ActionController::Base
|
||||
category_topic_ids = Category.pluck(:topic_id).compact
|
||||
@container_class = "wrap not-found-container"
|
||||
@top_viewed = TopicQuery.new(nil, except_topic_ids: category_topic_ids).list_top_for("monthly").topics.first(10)
|
||||
@recent = Topic.where.not(id: category_topic_ids).recent(10)
|
||||
@recent = Topic.includes(:category).where.not(id: category_topic_ids).recent(10)
|
||||
@slug = params[:slug].class == String ? params[:slug] : ''
|
||||
@slug = (params[:id].class == String ? params[:id] : '') if @slug.blank?
|
||||
@slug.tr!('-', ' ')
|
||||
|
Loading…
Reference in New Issue
Block a user