Make subject search more precise in global activities [SCI-3251]

This commit is contained in:
Oleksii Kriuchykhin 2019-03-28 17:03:05 +01:00
parent 5f663b3c74
commit 58af23e9b5

View file

@ -52,7 +52,7 @@ class GlobalActivitiesController < ApplicationController
results = {}
subject_types.each do |subject|
matched = subject.constantize
.search_by_name(current_user, teams, query)
.search_by_name(current_user, teams, query, whole_phrase: true)
.limit(Constants::SEARCH_LIMIT)
.pluck(:id, :name)
next if matched.length.zero?