Fix empty result name issue (#1812)

This commit is contained in:
aignatov-bio 2019-05-31 09:48:58 +02:00 committed by GitHub
parent 3681df7b9f
commit 94b220172d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ class GlobalActivitiesController < ApplicationController
subject_types.each do |subject|
matched = subject.constantize
.search_by_name(current_user, teams, query, whole_phrase: true)
.where.not(name: nil)
.where.not(name: nil).where.not(name: '')
.filter_by_teams(filter_teams)
.limit(Constants::SEARCH_LIMIT)
.pluck(:id, :name)