diff options
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 1b22907c10f..90d4bc674d9 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -29,6 +29,7 @@ class SearchController < ApplicationController @search_objects = search_service.search_objects render_commits if @scope == 'commits' + eager_load_user_status if @scope == 'users' check_single_commit_result end @@ -54,6 +55,12 @@ class SearchController < ApplicationController @search_objects = prepare_commits_for_rendering(@search_objects) end + def eager_load_user_status + return if Feature.disabled?(:users_search, default_enabled: true) + + @search_objects = @search_objects.eager_load(:status) # rubocop:disable CodeReuse/ActiveRecord + end + def check_single_commit_result if @search_results.single_commit_result? only_commit = @search_results.objects('commits').first |