summaryrefslogtreecommitdiff
path: root/app/controllers/autocomplete_controller.rb
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-11-03 12:22:56 +0200
committerValery Sizov <valery@gitlab.com>2016-11-04 13:41:14 +0200
commitb7dff1b072204c8c2ad480301b3139e4823c41f4 (patch)
treeb880d065fab69692dca0c637b27ae526d66d25ce /app/controllers/autocomplete_controller.rb
parent5ef2bd192aa9b3ecbfc23e83c6984e2a818fb736 (diff)
downloadgitlab-ce-b7dff1b072204c8c2ad480301b3139e4823c41f4.tar.gz
Fix: Todos Filter Shows All Users22588-todos-filter-shows-all-users
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r--app/controllers/autocomplete_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index b48668eea87..daa82336208 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -11,9 +11,13 @@ class AutocompleteController < ApplicationController
@users = @users.reorder(:name)
@users = @users.page(params[:page])
+ if params[:todo_filter].present?
+ @users = @users.todo_authors(current_user.id, params[:todo_state_filter])
+ end
+
if params[:search].blank?
# Include current user if available to filter by "Me"
- if params[:current_user] && current_user
+ if params[:current_user].present? && current_user
@users = [*@users, current_user]
end