Replace conditional with a guard statement.

This commit is contained in:
Cagdas Gerede 2016-11-12 11:16:07 +03:00
parent 4acedecc7b
commit 3b91c92719

View file

@ -29,13 +29,10 @@ class Projects::ForksController < Projects::ApplicationController
end end
def new def new
if current_user.nil? return authenticate_user! unless current_user
authenticate_user!
else
@namespaces = current_user.manageable_namespaces @namespaces = current_user.manageable_namespaces
@namespaces.delete(@project.namespace) @namespaces.delete(@project.namespace)
end end
end
def create def create
namespace = Namespace.find(params[:namespace_key]) namespace = Namespace.find(params[:namespace_key])