Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-31 14:00:53 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-12-08 12:47:16 +0300
commit83232be0e14cc8b35bf74532203a6e4371c15e70 (patch)
treed6cde69809c44055496954efe57b866404b3d0f2 /lib
parent34fc5b050a4e70bf491be9a49cfa2dc0a7a9a9a2 (diff)
Add nested groups support on data level
* add parent_id field to namespaces table to store relation with nested groups * create routes table to keep information about full path of every group and project * project/group lookup by full path from routes table Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--lib/constraints/group_url_constrainer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 7f94ede7940..96ccde760db 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -108,7 +108,7 @@ module API
if id =~ /^\d+$/
Group.find_by(id: id)
else
- Group.find_by(path: id)
+ Group.find_by_full_path(id)
end
end
diff --git a/lib/constraints/group_url_constrainer.rb b/lib/constraints/group_url_constrainer.rb
index 5711d96a586..bae4db1ca4d 100644
--- a/lib/constraints/group_url_constrainer.rb
+++ b/lib/constraints/group_url_constrainer.rb
@@ -4,7 +4,7 @@ class GroupUrlConstrainer
return false unless valid?(id)
- Group.find_by(path: id).present?
+ Group.find_by_full_path(id).present?
end
private