From 40397a5a43f637c3a20b07f9f49964fd92294c28 Mon Sep 17 00:00:00 2001 From: Andrej Date: Thu, 9 May 2024 15:00:56 +0200 Subject: [PATCH] Fix global search for assets [SCI-10684] --- app/javascript/vue/global_search/groups/assets.vue | 2 +- app/models/protocol.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/vue/global_search/groups/assets.vue b/app/javascript/vue/global_search/groups/assets.vue index 78bb0feb9..93d869eb1 100644 --- a/app/javascript/vue/global_search/groups/assets.vue +++ b/app/javascript/vue/global_search/groups/assets.vue @@ -17,7 +17,7 @@ - diff --git a/app/models/protocol.rb b/app/models/protocol.rb index 6e03acb75..f658e9e59 100644 --- a/app/models/protocol.rb +++ b/app/models/protocol.rb @@ -191,7 +191,7 @@ class Protocol < ApplicationRecord distinct.left_joins(steps: [:step_texts, { step_tables: :table }, { checklists: :checklist_items }, :step_comments]) - .where('(protocols.protocol_type IN (?) AND protocols.my_module_id IN (?)) OR (protocols.id IN (?))', + .where('(protocols.protocol_type IN (?) AND protocols.id IN (?)) OR (protocols.id IN (?))', [Protocol.protocol_types[:unlinked], Protocol.protocol_types[:linked]], protocol_my_modules, protocol_templates) .where_attributes_like_boolean(SEARCHABLE_ATTRIBUTES, query, options)