Separate private methods under the keyword on projects controller
This commit is contained in:
parent
f52e9d55de
commit
8476516e3d
1 changed files with 12 additions and 10 deletions
|
@ -284,6 +284,18 @@ class ProjectsController < Projects::ApplicationController
|
||||||
end
|
end
|
||||||
# rubocop: enable CodeReuse/ActiveRecord
|
# rubocop: enable CodeReuse/ActiveRecord
|
||||||
|
|
||||||
|
def resolve
|
||||||
|
@project = Project.find(params[:id])
|
||||||
|
|
||||||
|
if can?(current_user, :read_project, @project)
|
||||||
|
redirect_to @project
|
||||||
|
else
|
||||||
|
render_404
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
# Render project landing depending of which features are available
|
# Render project landing depending of which features are available
|
||||||
# So if page is not available in the list it renders the next page
|
# So if page is not available in the list it renders the next page
|
||||||
#
|
#
|
||||||
|
@ -453,14 +465,4 @@ class ProjectsController < Projects::ApplicationController
|
||||||
def present_project
|
def present_project
|
||||||
@project = @project.present(current_user: current_user)
|
@project = @project.present(current_user: current_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
def resolve
|
|
||||||
@project = Project.find(params[:id])
|
|
||||||
|
|
||||||
if can?(current_user, :read_project, @project)
|
|
||||||
redirect_to @project
|
|
||||||
else
|
|
||||||
render_404
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue