mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:52:45 +08:00
FIX: Show links with 0 clicks in top links section (#16016)
This is useful to moderators to see if users post spam links.
This commit is contained in:
parent
ae1d2d957f
commit
94883dd326
|
@ -40,7 +40,6 @@ class UserSummary
|
|||
.merge(Topic.listable_topics.visible.secured(@guardian))
|
||||
.where(user: @user)
|
||||
.where(internal: false, reflection: false, quote: false)
|
||||
.where('clicks > 0')
|
||||
.order('clicks DESC, topic_links.created_at DESC')
|
||||
.limit(MAX_SUMMARY_RESULTS)
|
||||
end
|
||||
|
|
|
@ -93,11 +93,4 @@ describe UserSummary do
|
|||
expect(summary.top_categories.first[:topic_count]).to eq(1)
|
||||
expect(summary.top_categories.first[:post_count]).to eq(1)
|
||||
end
|
||||
|
||||
it "does not include summaries with no clicks" do
|
||||
post = Fabricate(:post, raw: "[example](https://example.com)")
|
||||
TopicLink.extract_from(post)
|
||||
summary = UserSummary.new(post.user, Guardian.new)
|
||||
expect(summary.links.length).to eq(0)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user