Open wojciech-kulik opened 5 months ago
Let's assume that I'm in a group A. Now I want to create a structure:
A
A -- B ---- C
Is there any function that makes this task easy? Or do I have to split the path and go group by group and create it?
That's what I managed to achieve so far:
def add_group(project, group_path) splitted_path = group_path.split("/") for i in 1..(splitted_path.length - 2) current_path = splitted_path[0..i].join("/") new_group_path = current_path + "/" + splitted_path[i + 1] parent_group = find_group_by_absolute_dir_path(project, current_path) parent_group.new_group(splitted_path[i + 1], new_group_path) unless parent_group.nil? end project.save end
Let's assume that I'm in a group
A
. Now I want to create a structure:Is there any function that makes this task easy? Or do I have to split the path and go group by group and create it?
That's what I managed to achieve so far: