Commit c1583c6d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Find issues and Mr by iid in controller

parent 2e5481b7
...@@ -91,7 +91,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -91,7 +91,7 @@ class Projects::IssuesController < Projects::ApplicationController
protected protected
def issue def issue
@issue ||= @project.issues.find(params[:id]) @issue ||= @project.issues.find_by_iid!(params[:id])
end end
def authorize_modify_issue! def authorize_modify_issue!
......
...@@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
def merge_request def merge_request
@merge_request ||= @project.merge_requests.find(params[:id]) @merge_request ||= @project.merge_requests.find_by_iid!(params[:id])
end end
def authorize_modify_merge_request! def authorize_modify_merge_request!
......
...@@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController
def autocomplete_sources def autocomplete_sources
@suggestions = { @suggestions = {
emojis: Emoji.names, emojis: Emoji.names,
issues: @project.issues.select([:id, :title, :description]), issues: @project.issues.select([:iid, :title, :description]),
members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } } members: @project.team.members.sort_by(&:username).map { |user| { username: user.username, name: user.name } }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment