PERF: Remove N+1 queries on search topic list item serializer.

This commit is contained in:
Vinoth Kannan 2019-03-17 23:20:05 +05:30
parent 8b8512e73e
commit ca2d537665
1 changed files with 1 additions and 0 deletions

View File

@ -505,6 +505,7 @@ SQL
TopicList.preloaded_custom_fields << "accepted_answer_post_id" if TopicList.respond_to? :preloaded_custom_fields
Site.preloaded_category_custom_fields << "enable_accepted_answers" if Site.respond_to? :preloaded_category_custom_fields
Search.preloaded_topic_custom_fields << "accepted_answer_post_id" if Search.respond_to? :preloaded_topic_custom_fields
if CategoryList.respond_to?(:preloaded_topic_custom_fields)
CategoryList.preloaded_topic_custom_fields << "accepted_answer_post_id"