diff options
author | Rémy Coutable <remy@rymai.me> | 2016-05-18 23:45:25 -0500 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-05-18 23:45:25 -0500 |
commit | 129bb6c2a71c8499daeb5d55f657b0eda8366bc8 (patch) | |
tree | 948fb27e5e4adbfbfd293342bff1fe5f57e14f91 /app/models/milestone.rb | |
parent | f29d8b64e4bbea0dce64b4dfbae14422d64899c9 (diff) | |
download | gitlab-ce-129bb6c2a71c8499daeb5d55f657b0eda8366bc8.tar.gz |
Address Yorick's feedbackeReGeBe/gitlab-ce-feature/milestone-md
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r-- | app/models/milestone.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 31a54f44453..e0c8454a998 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -67,7 +67,7 @@ class Milestone < ActiveRecord::Base # NOTE: The iid pattern only matches when all characters on the expression # are digits, so it will match %2 but not %2.1 because that's probably a # milestone name and we want it to be matched as such. - %r{ + @reference_pattern ||= %r{ (#{Project.reference_pattern})? #{Regexp.escape(reference_prefix)} (?: @@ -195,7 +195,7 @@ class Milestone < ActiveRecord::Base private def milestone_format_reference(format = :iid) - raise StandardError, 'Unknown format' unless [:iid, :name].include?(format) + raise ArgumentError, 'Unknown format' unless [:iid, :name].include?(format) if format == :name && !name.include?('"') %("#{name}") |