summaryrefslogtreecommitdiff
path: root/app/controllers/autocomplete_controller.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2016-02-09 12:02:52 +0100
committerZeger-Jan van de Weg <zegerjan@gitlab.com>2016-02-22 12:10:56 +0100
commitdf27b3a1742048358674733d9cb3392348d5e964 (patch)
treefd16fca8cf559793360141b21549ad3053a11178 /app/controllers/autocomplete_controller.rb
parent04d1b412587028260ac219a32bdf3b03ac022308 (diff)
downloadgitlab-ce-df27b3a1742048358674733d9cb3392348d5e964.tar.gz
Issuable can be assigned to author
Closes #9014 The only difference with #9014 is that I thoughed the author should also be able to assign the issue. If this is unwanted behavior Ill revert it.
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r--app/controllers/autocomplete_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index 77c8dafc012..23f2ab45ff4 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -12,8 +12,14 @@ class AutocompleteController < ApplicationController
if params[:search].blank?
# Include current user if available to filter by "Me"
if params[:current_user] && current_user
- @users = [*@users, current_user].uniq
+ @users = [*@users, current_user]
end
+
+ if params[:author_id]
+ @users = [User.find(params[:author_id]), *@users]
+ end
+
+ @users.uniq!
end
render json: @users, only: [:name, :username, :id], methods: [:avatar_url]