diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-03-16 08:19:02 +0100 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2019-03-16 08:19:02 +0100 |
commit | a68c1cdc38ffe8d4fe21c1bf562c8456c354da7f (patch) | |
tree | 40626328888ffa46d3495f2f9dc219d1ee006e88 /app/controllers/search_controller.rb | |
parent | b53376592491cf2016fe68fecaf5f090cf4627b4 (diff) | |
parent | 27ac48c394780df923eeb94f3a7f47f6a5f4c649 (diff) | |
download | gitlab-ce-users-search-results.tar.gz |
Merge branch 'siemens/gitlab-ce-feature/users-search-results' into users-search-resultsusers-search-results
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 |