mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 11:12:23 +08:00
86ffa3ba4f
Previously thumbnails were only preloaded for queries using `TopicQuery#default_results`, which meant that requests for PM topic lists would lead to N+1 queries. This commit moves the preloading into TopicList#load_topics, along with other similar preloads (e.g. plugin custom fields) The direct call to `ActiveRecord::Associations::Preloader#preload` is necessary because `@topics` can be an array, not an `ActiveRecord::Relation` |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |