mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
PERF: Remove category_user lookup when loading private messages.
Private messages do not belong to categories so the query is unnecessary overhead.
This commit is contained in:
@ -48,6 +48,16 @@ describe TopicList do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#load_topics' do
|
||||
it 'loads additional data for serialization' do
|
||||
category_user = CategoryUser.create!(user: user, category: topic.category)
|
||||
|
||||
topic = topic_list.load_topics.first
|
||||
|
||||
expect(topic.category_user_data).to eq(category_user)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#top_tags' do
|
||||
it 'should return the right tags' do
|
||||
tag = Fabricate(:tag, topics: [topic])
|
||||
|
Reference in New Issue
Block a user