Commit 3d69a322 authored by charlie ablett's avatar charlie ablett

Rename confusing method for clarity

There's a method called `project_namespace` that has nothing
to do with the model nor relationship that we've introduced.
Renaming it to `project_parent` for clarity
parent 19d9aa5f
......@@ -45,7 +45,7 @@ module Projects
if namespace_id
# Find matching namespace and check if it allowed
# for current user if namespace_id passed.
unless current_user.can?(:create_projects, project_namespace)
unless current_user.can?(:create_projects, parent_namespace)
@project.namespace_id = nil
deny_namespace
return @project
......@@ -227,14 +227,14 @@ module Projects
def extra_attributes_for_measurement
{
current_user: current_user&.name,
project_full_path: "#{project_namespace&.full_path}/#{@params[:path]}"
project_full_path: "#{parent_namespace&.full_path}/#{@params[:path]}"
}
end
private
def project_namespace
@project_namespace ||= Namespace.find_by_id(@params[:namespace_id]) || current_user.namespace
def parent_namespace
@parent_namespace ||= Namespace.find_by_id(@params[:namespace_id]) || current_user.namespace
end
def create_from_template?
......
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