From c85f5187f3099397ec4ad58854dc56d114e36452 Mon Sep 17 00:00:00 2001 From: aignatov-bio <47317017+aignatov-bio@users.noreply.github.com> Date: Tue, 5 Oct 2021 13:45:09 +0200 Subject: [PATCH] Fix duplicarte results in activities filters [SCI-5948] (#3579) --- app/controllers/global_activities_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/global_activities_controller.rb b/app/controllers/global_activities_controller.rb index 67c493147..dfe5b5adf 100644 --- a/app/controllers/global_activities_controller.rb +++ b/app/controllers/global_activities_controller.rb @@ -148,9 +148,9 @@ class GlobalActivitiesController < ApplicationController matched = matched.where(project_id: selected_subject['Project']) if subject == Experiment matched = matched.where(experiment_id: selected_subject['Experiment']) if subject == MyModule matched = matched.where(repository_id: selected_subject['RepositoryBase']) if subject == RepositoryRow + matched = matched.limit(Constants::SEARCH_LIMIT) - matched = matched.limit(Constants::SEARCH_LIMIT).pluck(:id, :name) - matched.map { |pr| { value: pr[0], label: escape_input(pr[1]) } } + matched.map { |pr| { value: pr.id, label: escape_input(pr.name) } } end def activity_filter_params