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
protected
def issue
@issue ||= @project.issues.find(params[:id])
@issue ||= @project.issues.find_by_iid!(params[:id])
end
def authorize_modify_issue!
......
......@@ -132,7 +132,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def merge_request
@merge_request ||= @project.merge_requests.find(params[:id])
@merge_request ||= @project.merge_requests.find_by_iid!(params[:id])
end
def authorize_modify_merge_request!
......
......@@ -104,7 +104,7 @@ class ProjectsController < Projects::ApplicationController
def autocomplete_sources
@suggestions = {
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 } }
}
......
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