FIX: Don't show links to private messages in the gutter

This commit is contained in:
Robin Ward 2014-05-11 15:16:28 -04:00
parent 8714391bb2
commit 2bb63ffb38
1 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,7 @@ class TopicLink < ActiveRecord::Base
builder.where('ftl.topic_id = :topic_id', topic_id: topic_id)
builder.where('ft.deleted_at IS NULL')
builder.where('ft.archetype <> :archetype', archetype: Archetype.private_message)
builder.secure_category(guardian.secure_category_ids)
@ -72,6 +73,7 @@ class TopicLink < ActiveRecord::Base
ORDER BY reflection ASC, clicks DESC")
builder.where('t.deleted_at IS NULL')
builder.where('t.archetype <> :archetype', archetype: Archetype.private_message)
# not certain if pluck is right, cause it may interfere with caching
builder.where('l.post_id IN (:post_ids)', post_ids: posts.map(&:id))