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
@@ -91,7 +91,7 @@ class Projects::IssuesController < Projects::ApplicationController | @@ -91,7 +91,7 @@ class Projects::IssuesController < Projects::ApplicationController | ||
91 | protected | 91 | protected |
92 | 92 | ||
93 | def issue | 93 | def issue |
94 | - @issue ||= @project.issues.find(params[:id]) | 94 | + @issue ||= @project.issues.find_by_iid!(params[:id]) |
95 | end | 95 | end |
96 | 96 | ||
97 | def authorize_modify_issue! | 97 | def authorize_modify_issue! |
app/controllers/projects/merge_requests_controller.rb
@@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController | @@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController | ||
132 | end | 132 | end |
133 | 133 | ||
134 | def merge_request | 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 | end | 136 | end |
137 | 137 | ||
138 | def authorize_modify_merge_request! | 138 | def authorize_modify_merge_request! |
app/controllers/projects_controller.rb
@@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController | @@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController | ||
104 | def autocomplete_sources | 104 | def autocomplete_sources |
105 | @suggestions = { | 105 | @suggestions = { |
106 | emojis: Emoji.names, | 106 | emojis: Emoji.names, |
107 | - issues: @project.issues.select([:id, :title, :description]), | 107 | + issues: @project.issues.select([:iid, :title, :description]), |
108 | members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } } | 108 | members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } } |
109 | } | 109 | } |
110 | 110 |