Commit c1583c6d74e7a7088cf6d22957851261de965f23
1 parent
2e5481b7
Exists in
master
and in
4 other branches
Find issues and Mr by iid in controller
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
app/controllers/projects/issues_controller.rb
app/controllers/projects/merge_requests_controller.rb
... | ... | @@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController |
132 | 132 | end |
133 | 133 | |
134 | 134 | def merge_request |
135 | - @merge_request ||= @project.merge_requests.find(params[:id]) | |
135 | + @merge_request ||= @project.merge_requests.find_by_iid!(params[:id]) | |
136 | 136 | end |
137 | 137 | |
138 | 138 | def authorize_modify_merge_request! | ... | ... |
app/controllers/projects_controller.rb
... | ... | @@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController |
104 | 104 | def autocomplete_sources |
105 | 105 | @suggestions = { |
106 | 106 | emojis: Emoji.names, |
107 | - issues: @project.issues.select([:id, :title, :description]), | |
107 | + issues: @project.issues.select([:iid, :title, :description]), | |
108 | 108 | members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } } |
109 | 109 | } |
110 | 110 | ... | ... |