summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-04-15 15:43:26 +0000
committerJacob Schatz <jschatz1@gmail.com>2016-04-15 15:43:26 +0000
commitbb59a1f98eb44cbe288d876eb963e9467b8637f4 (patch)
tree0c0ad27bc8781a853ced8382265efd19669f6930 /app/controllers
parent8b7bf2a0e0fb4ec5765f0b1da74a121a82659113 (diff)
parent33f8b06c3925fbefd6eac38efc71eac8b787ebd7 (diff)
downloadgitlab-ce-bb59a1f98eb44cbe288d876eb963e9467b8637f4.tar.gz
Merge branch 'assign-to-issuable-opener' into 'master'
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. /cc @DouweM See merge request !2765
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/autocomplete_controller.rb9
-rw-r--r--app/controllers/projects/issues_controller.rb4
2 files changed, 10 insertions, 3 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index 81ba58ce49c..eb0abc80ab4 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -12,8 +12,15 @@ 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].present?
+ author = User.find_by_id(params[:author_id])
+ @users = [author, *@users] if author
+ end
+
+ @users.uniq!
end
render json: @users, only: [:name, :username, :id], methods: [:avatar_url]
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index c26cfeccf1d..38214f04793 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -60,8 +60,8 @@ class Projects::IssuesController < Projects::ApplicationController
end
def show
- @note = @project.notes.new(noteable: @issue)
- @notes = @issue.notes.nonawards.with_associations.fresh
+ @note = @project.notes.new(noteable: @issue)
+ @notes = @issue.notes.nonawards.with_associations.fresh
@noteable = @issue
respond_to do |format|