diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-23 04:08:33 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-24 04:38:35 +0300 |
commit | b0498c176fa134761d899c9b369be12f1ca789c5 (patch) | |
tree | dcf223813e0b1bb5932a94793a6f827771517a96 /app/models | |
parent | ed16c351c5acdf1ad2e401e72490320d06af6e91 (diff) |
Remove changes that are not absolutely necessary
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 10 | ||||
-rw-r--r-- | app/models/user.rb | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 29af57d7664..cfca0dcd2f2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -205,8 +205,8 @@ class Project < ActiveRecord::Base presence: true, dynamic_path: true, length: { maximum: 255 }, - format: { with: Gitlab::PathRegex.project_path_format_regex, - message: Gitlab::PathRegex.project_path_format_message }, + format: { with: Gitlab::Regex.project_path_format_regex, + message: Gitlab::Regex.project_path_regex_message }, uniqueness: { scope: :namespace_id } validates :namespace, presence: true @@ -380,9 +380,11 @@ class Project < ActiveRecord::Base end def reference_pattern + name_pattern = Gitlab::Regex::FULL_NAMESPACE_REGEX_STR + %r{ - ((?<namespace>#{Gitlab::PathRegex::FULL_NAMESPACE_FORMAT_REGEX})\/)? - (?<project>#{Gitlab::PathRegex::PROJECT_PATH_FORMAT_REGEX}) + ((?<namespace>#{name_pattern})\/)? + (?<project>#{name_pattern}) }x end diff --git a/app/models/user.rb b/app/models/user.rb index 55614233230..837ab78228b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -367,7 +367,7 @@ class User < ActiveRecord::Base def reference_pattern %r{ #{Regexp.escape(reference_prefix)} - (?<user>#{Gitlab::PathRegex::FULL_NAMESPACE_FORMAT_REGEX}) + (?<user>#{Gitlab::Regex::FULL_NAMESPACE_REGEX_STR}) }x end |