summaryrefslogtreecommitdiff
path: root/app/validators
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@gitlab.com>2017-04-12 11:28:23 +0200
committerBob Van Landuyt <bob@gitlab.com>2017-05-01 11:14:24 +0200
commitbccf8d86c57a141aeb60d96bc3139fe2b5dc9240 (patch)
tree8d9dadad95c30bef1c9f261f7804721d2198056f /app/validators
parent3143a5d2602de521b432231d701aedcc2844c088 (diff)
downloadgitlab-ce-bccf8d86c57a141aeb60d96bc3139fe2b5dc9240.tar.gz
Rename `NamespaceValidator` to `DynamicPathValidator`
This reflects better that it validates paths instead of a namespace model
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/dynamic_path_validator.rb (renamed from app/validators/namespace_validator.rb)9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/validators/namespace_validator.rb b/app/validators/dynamic_path_validator.rb
index ed71d5ad5b5..ce363c052d8 100644
--- a/app/validators/namespace_validator.rb
+++ b/app/validators/dynamic_path_validator.rb
@@ -1,10 +1,11 @@
-# NamespaceValidator
+# DynamicPathValidator
#
-# Custom validator for GitLab namespace values.
+# Custom validator for GitLab path values.
+# These paths are assigned to `Namespace` (& `Group` as a subclass) & `Project`
#
# Values are checked for formatting and exclusion from a list of reserved path
# names.
-class NamespaceValidator < ActiveModel::EachValidator
+class DynamicPathValidator < ActiveModel::EachValidator
# All routes that appear on the top level must be listed here.
# This will make sure that groups cannot be created with these names
# as these routes would be masked by the paths already in place.
@@ -124,6 +125,8 @@ class NamespaceValidator < ActiveModel::EachValidator
record.has_parent? ? :wildcard : :top_level
when Project
:wildcard
+ when User
+ :top_level
else
:strict
end