From 54e84eab1667ea12765abd2fcc206b7f6cbe3ff3 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Mon, 20 Oct 2025 13:21:28 +0200 Subject: [PATCH] Fix duplicated records appearence in global search [SCI-12477] --- app/controllers/search_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 43a7dabba..43b2eeefb 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -139,11 +139,8 @@ class SearchController < ApplicationController protected def search_by_name(options = {}) - @records = @model.search(current_user, - @include_archived, - @search_query, - @teams, - options) + @records = @model.search(current_user, @include_archived, @search_query, @teams, options) + @records = @model.from(@records, @model.table_name) .select("COUNT(\"#{@model.table_name}\".\"id\") OVER() AS filtered_count") .select("\"#{@model.table_name}\".*")