summaryrefslogtreecommitdiff
path: root/app/models/external_issue.rb
diff options
context:
space:
mode:
authorBaldinof <baldinof@gmail.com>2016-04-12 10:01:52 +0200
committerBaldinof <baldinof@gmail.com>2016-04-12 10:01:52 +0200
commit3918fce5bd073e18addb7d1d4aaf3c81ce8150b0 (patch)
tree9c4ce48085f9afce77f623547682a6715741f3f5 /app/models/external_issue.rb
parentb372968e936a8b02f8d7ff73a1e1cc25b332406c (diff)
downloadgitlab-ce-3918fce5bd073e18addb7d1d4aaf3c81ce8150b0.tar.gz
Hide number sign for string prefixed external issues
Diffstat (limited to 'app/models/external_issue.rb')
-rw-r--r--app/models/external_issue.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/external_issue.rb b/app/models/external_issue.rb
index 92f1f174941..d47b479faa8 100644
--- a/app/models/external_issue.rb
+++ b/app/models/external_issue.rb
@@ -34,15 +34,13 @@ class ExternalIssue
%r{(?<issue>\b([A-Z][A-Z0-9_]+-)\d+)}
end
- def self.reference_prefix
- '#'
- end
-
def to_reference(_from_project = nil)
id
end
def reference_link_text(from_project = nil)
- "#{self.class.reference_prefix}#{id}"
+ return "##{id}" if /^\d+$/.match(id)
+
+ id
end
end