diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-08-15 22:18:45 +0300 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2019-03-14 20:16:04 +0300 |
commit | 5a45b54fd96a49ca83dcf9e2d06c1bdcdacaa59e (patch) | |
tree | 84ecec716ec0e2c90fe9b8bc5c4ece06a9c83470 /app/controllers/search_controller.rb | |
parent | 40962ac4aa5a900af14c045a812144a22f512991 (diff) |
search results: show user's status emoji
Diffstat (limited to 'app/controllers/search_controller.rb')
-rw-r--r-- | app/controllers/search_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 1b22907c10f..a7b789f848a 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,10 @@ class SearchController < ApplicationController @search_objects = prepare_commits_for_rendering(@search_objects) end + def eager_load_user_status + @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 |