From 4beb3b31a5e64ebf1af55ad643e9b1a55b3181ab Mon Sep 17 00:00:00 2001 From: Sawy Date: Thu, 21 Sep 2023 14:39:55 +0300 Subject: [PATCH] CV2-3738: fix tests --- lib/check_search.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/check_search.rb b/lib/check_search.rb index a3e53119f1..33de85cda6 100644 --- a/lib/check_search.rb +++ b/lib/check_search.rb @@ -351,6 +351,10 @@ def adjust_project_filter # Invalidate the search if empty... otherwise, adjust the projects filter @options['projects'] = project_ids.empty? ? [0] : project_ids end + if Team.current && !feed_query? && [@options['team_id']].flatten.size == 1 + t = Team.find([@options['team_id']].flatten.first) + @options['projects'] = @options['projects'].blank? ? (Project.where(team_id: t.id).map(&:id) + [nil]) : Project.where(id: @options['projects'], team_id: t.id).map(&:id) + end @options['projects'] += [nil] if @options['none_project'] end