Extract set_project_name_from_path method
This commit is contained in:
parent
ae057666bf
commit
d91dd2f58d
|
@ -22,17 +22,7 @@ module Projects
|
|||
return @project
|
||||
end
|
||||
|
||||
# Set project name from path
|
||||
if @project.name.present? && @project.path.present?
|
||||
# if both name and path set - everything is ok
|
||||
elsif @project.path.present?
|
||||
# Set project name from path
|
||||
@project.name = @project.path.dup
|
||||
elsif @project.name.present?
|
||||
# For compatibility - set path from name
|
||||
# TODO: remove this in 8.0
|
||||
@project.path = @project.name.dup.parameterize
|
||||
end
|
||||
set_project_name_from_path
|
||||
|
||||
# get namespace id
|
||||
namespace_id = params[:namespace_id]
|
||||
|
@ -144,5 +134,19 @@ module Projects
|
|||
service.save!
|
||||
end
|
||||
end
|
||||
|
||||
def set_project_name_from_path
|
||||
# Set project name from path
|
||||
if @project.name.present? && @project.path.present?
|
||||
# if both name and path set - everything is ok
|
||||
elsif @project.path.present?
|
||||
# Set project name from path
|
||||
@project.name = @project.path.dup
|
||||
elsif @project.name.present?
|
||||
# For compatibility - set path from name
|
||||
# TODO: remove this in 8.0
|
||||
@project.path = @project.name.dup.parameterize
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue