From f28df506f97232198573b066113b3aeed18ee53e Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 17 May 2017 09:08:40 +0200 Subject: [PATCH] Fix bug in counting search results for assets [SCI-1284] --- app/controllers/search_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index e9fb7cde2..db576ee32 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -96,7 +96,14 @@ class SearchController < ApplicationController end def count_by_name(model) - search_by_name(model).limit(nil).offset(nil).size + model.search(current_user, + true, + @search_query, + Constants::SEARCH_NO_LIMIT, + nil, + match_case: @search_case, + whole_word: @search_whole_word, + whole_phrase: @search_whole_phrase).size end def count_search_results