From 5a45b54fd96a49ca83dcf9e2d06c1bdcdacaa59e Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Wed, 15 Aug 2018 21:18:45 +0200 Subject: search results: show user's status emoji --- app/controllers/search_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/controllers/search_controller.rb') 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 -- cgit v1.2.1 From 55629a2e4d0237760e1e252f9dbe658f39045156 Mon Sep 17 00:00:00 2001 From: Alexis Reigel Date: Wed, 19 Dec 2018 15:24:46 +0100 Subject: add feature flag for users search --- app/controllers/search_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/search_controller.rb') diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index a7b789f848a..90d4bc674d9 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -56,6 +56,8 @@ class SearchController < ApplicationController 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 -- cgit v1.2.1