mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 10:52:45 +08:00
21bb28df91
This commit improves `TopicsController#show` to not load suggested and related topics unless it is the last page of the topic's view. Previously, we avoided loading suggested and related topics by the use of conditionals in the `TopicViewSerializer` to avoid calling `TopicView#suggested_topics` and `TopicView#related_topics`. However, this pattern is not reliable as the methods can still be called from other spots in the code base. Instead, we ensure that `TopicView#include_suggested` and `TopicView#include_related` is set correctly on the instance of `TopicView` which ensures that for the given instance, `TopicView#suggested_topics` and `TopicView#related_topics` will be a noop. |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |