summaryrefslogtreecommitdiff
path: root/app/controllers/projects/application_controller.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2017-05-05 10:48:01 -0700
committerMichael Kozono <mkozono@gmail.com>2017-05-05 12:12:51 -0700
commite1c245af51e294c84552cff8021342e7ae493b8a (patch)
treee09f11c25d7b232bfdb08ccaaaa4f76b6d20b4bf /app/controllers/projects/application_controller.rb
parentf05469f99b8c52c4dab7ac9160b47676c87124f9 (diff)
downloadgitlab-ce-e1c245af51e294c84552cff8021342e7ae493b8a.tar.gz
Resolve discussions
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r--app/controllers/projects/application_controller.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 25232fc9457..b4b0dfc3eb8 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -21,13 +21,12 @@ class Projects::ApplicationController < ApplicationController
end
def project
- @project ||= find_routable!(Project,
- File.join(params[:namespace_id], params[:project_id] || params[:id]),
- extra_authorization_proc: project_not_being_deleted?)
- end
+ return @project if @project
+
+ path = File.join(params[:namespace_id], params[:project_id] || params[:id])
+ auth_proc = ->(project) { !project.pending_delete? }
- def project_not_being_deleted?
- ->(project) { !project.pending_delete? }
+ @project = find_routable!(Project, path, extra_authorization_proc: auth_proc)
end
def repository