From 2bb63ffb3886fe9defedea1300b47ee7b872ac2d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Sun, 11 May 2014 15:16:28 -0400 Subject: [PATCH] FIX: Don't show links to private messages in the gutter --- app/models/topic_link.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/topic_link.rb b/app/models/topic_link.rb index cd8a106d4a2..803444240df 100644 --- a/app/models/topic_link.rb +++ b/app/models/topic_link.rb @@ -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))