diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-08-29 00:49:01 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-08-29 00:53:35 -0500 |
commit | 6f03ddcdc3af1fbb840498a0e4765458079f0b0f (patch) | |
tree | 9301cd3835e573d491dd8799533799365df996bd /app/controllers | |
parent | 0a8d0924fe9a1525b92423411dc1bfcdc9760833 (diff) | |
download | gitlab-ce-6f03ddcdc3af1fbb840498a0e4765458079f0b0f.tar.gz |
Address some suggestions from first code review
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects_controller.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8ad99c01e15..51cf37b9438 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -3,7 +3,6 @@ class ProjectsController < Projects::ApplicationController include ExtractsPath before_action :authenticate_user!, except: [:index, :show, :activity, :refs] - before_action :namespace, only: [:new] before_action :project, except: [:index, :new, :create] before_action :repository, except: [:index, :new, :create] before_action :assign_ref_vars, only: [:show], if: :repo_exists? @@ -21,7 +20,7 @@ class ProjectsController < Projects::ApplicationController end def new - build_project + @project ||= Project.new(params.permit(:namespace_id)) end def edit @@ -396,12 +395,4 @@ class ProjectsController < Projects::ApplicationController def project_export_enabled render_404 unless current_application_settings.project_export_enabled? end - - def namespace - @namespace ||= Namespace.find(params[:namespace_id]) if params[:namespace_id].present? - end - - def build_project - @project ||= namespace ? namespace.projects.new : Project.new - end end |