summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-05-18 23:45:25 -0500
committerRémy Coutable <remy@rymai.me>2016-05-18 23:45:25 -0500
commit129bb6c2a71c8499daeb5d55f657b0eda8366bc8 (patch)
tree948fb27e5e4adbfbfd293342bff1fe5f57e14f91 /app/models/milestone.rb
parentf29d8b64e4bbea0dce64b4dfbae14422d64899c9 (diff)
downloadgitlab-ce-129bb6c2a71c8499daeb5d55f657b0eda8366bc8.tar.gz
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb4
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}")