Address Yorick's feedback

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2016-05-18 23:45:25 -05:00
parent f29d8b64e4
commit 129bb6c2a7
No known key found for this signature in database
GPG key ID: 46DF07E5CD9E96AB
2 changed files with 2 additions and 4 deletions

View file

@ -2,8 +2,6 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.8.0 (unreleased) v 8.8.0 (unreleased)
- Implement GFM references for milestones (Alejandro Rodríguez) - Implement GFM references for milestones (Alejandro Rodríguez)
v 8.7.1 (unreleased)
- Snippets tab under user profile. !4001 (Long Nguyen) - Snippets tab under user profile. !4001 (Long Nguyen)
- Fix error when using link to uploads in global snippets - Fix error when using link to uploads in global snippets
- Assign labels and milestone to target project when moving issue. !3934 (Long Nguyen) - Assign labels and milestone to target project when moving issue. !3934 (Long Nguyen)

View file

@ -67,7 +67,7 @@ class Milestone < ActiveRecord::Base
# NOTE: The iid pattern only matches when all characters on the expression # 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 # 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. # milestone name and we want it to be matched as such.
%r{ @reference_pattern ||= %r{
(#{Project.reference_pattern})? (#{Project.reference_pattern})?
#{Regexp.escape(reference_prefix)} #{Regexp.escape(reference_prefix)}
(?: (?:
@ -195,7 +195,7 @@ class Milestone < ActiveRecord::Base
private private
def milestone_format_reference(format = :iid) 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?('"') if format == :name && !name.include?('"')
%("#{name}") %("#{name}")