summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-08 13:40:32 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-08 13:40:32 +0100
commit926c3bef9fbda49d5cab268bcd83355142e945c1 (patch)
tree1dc2b7eb13485f0fc656cc913ca56e57b672b62a /app/models/namespace.rb
parent1a10945066d0da1801bb4cf89ce5f54996f1756f (diff)
parentf5430e48b42227f1c1874ca27c6907f0f704be28 (diff)
downloadgitlab-ce-reference-pipeline-and-caching.tar.gz
Merge branch 'master' into reference-pipeline-and-cachingreference-pipeline-and-caching
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 20b92e68d61..1c4e101cc10 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -23,19 +23,17 @@ class Namespace < ActiveRecord::Base
validates :owner, presence: true, unless: ->(n) { n.type == "Group" }
validates :name,
- presence: true, uniqueness: true,
length: { within: 0..255 },
- format: { with: Gitlab::Regex.namespace_name_regex,
- message: Gitlab::Regex.namespace_name_regex_message }
+ namespace_name: true,
+ presence: true,
+ uniqueness: true
validates :description, length: { within: 0..255 }
validates :path,
- uniqueness: { case_sensitive: false },
- presence: true,
length: { within: 1..255 },
- exclusion: { in: Gitlab::Blacklist.path },
- format: { with: Gitlab::Regex.namespace_regex,
- message: Gitlab::Regex.namespace_regex_message }
+ namespace: true,
+ presence: true,
+ uniqueness: { case_sensitive: false }
delegate :name, to: :owner, allow_nil: true, prefix: true