From 4b0ac91bfb2d7bb39f89ce1ac328c46e0168d47a Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 2 Apr 2019 10:46:59 +0800 Subject: [PATCH] DEV: Remove duplicated scope. `.joins(:topic)` will automatically add the `deleted_at IS NULL` scope. --- lib/search.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/search.rb b/lib/search.rb index f7b89e4ded..61b4c251e7 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -734,7 +734,6 @@ class Search posts = Post.where(post_type: Topic.visible_post_types(@guardian.user)) .joins(:post_search_data, :topic) .joins("LEFT JOIN categories ON categories.id = topics.category_id") - .where("topics.deleted_at" => nil) is_topic_search = @search_context.present? && @search_context.is_a?(Topic)