Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pl@neopoly.de>2018-07-21 11:11:07 +0300
committerPeter Leitzen <pl@neopoly.de>2018-08-10 17:45:11 +0300
commitd23fbbc6928983582198092cf28a0cd46d30252f (patch)
treedd4f68905cbd71c1596e8fa823a898bdbfa537a5 /app/controllers/projects/autocomplete_sources_controller.rb
parent4779c43ef9c2c3d534effdbacf3af910ed3e3c3e (diff)
Build noteables in AutocompleteSourcesController#target
Diffstat (limited to 'app/controllers/projects/autocomplete_sources_controller.rb')
-rw-r--r--app/controllers/projects/autocomplete_sources_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/autocomplete_sources_controller.rb b/app/controllers/projects/autocomplete_sources_controller.rb
index 07627ffb69f..eaaac5ca940 100644
--- a/app/controllers/projects/autocomplete_sources_controller.rb
+++ b/app/controllers/projects/autocomplete_sources_controller.rb
@@ -34,9 +34,9 @@ class Projects::AutocompleteSourcesController < Projects::ApplicationController
def target
case params[:type]&.downcase
when 'issue'
- IssuesFinder.new(current_user, project_id: @project.id).find_by(iid: params[:type_id])
+ IssuesFinder.new(current_user, project_id: @project.id).find_by(iid: params[:type_id]) || @project.issues.build
when 'mergerequest'
- MergeRequestsFinder.new(current_user, project_id: @project.id).find_by(iid: params[:type_id])
+ MergeRequestsFinder.new(current_user, project_id: @project.id).find_by(iid: params[:type_id]) || @project.merge_requests.build
when 'commit'
@project.commit(params[:type_id])
end