summaryrefslogtreecommitdiff
path: root/app/models/concerns/mentionable
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-08-29 14:38:42 +0100
committerLin Jen-Shin <godfat@godfat.org>2018-09-17 19:36:53 +0800
commit9357585ecacacfa0618b4f4172d5ea7dd0b1c5ae (patch)
treea2fb60da46404df95705f2ce9f6a1be49cfa47aa /app/models/concerns/mentionable
parent896c89e71dcc19d742f8609ed7f81c765c399c8e (diff)
downloadgitlab-ce-9357585ecacacfa0618b4f4172d5ea7dd0b1c5ae.tar.gz
Remove EE-specific code from Mentionable
Diffstat (limited to 'app/models/concerns/mentionable')
-rw-r--r--app/models/concerns/mentionable/reference_regexes.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/models/concerns/mentionable/reference_regexes.rb b/app/models/concerns/mentionable/reference_regexes.rb
index f6fd28bac33..fe8fbb71184 100644
--- a/app/models/concerns/mentionable/reference_regexes.rb
+++ b/app/models/concerns/mentionable/reference_regexes.rb
@@ -5,13 +5,19 @@ module Mentionable
def self.reference_pattern(link_patterns, issue_pattern)
Regexp.union(link_patterns,
issue_pattern,
- Commit.reference_pattern,
- MergeRequest.reference_pattern)
+ *other_patterns)
+ end
+
+ def self.other_patterns
+ [
+ Commit.reference_pattern,
+ MergeRequest.reference_pattern
+ ]
end
DEFAULT_PATTERN = begin
issue_pattern = Issue.reference_pattern
- link_patterns = Regexp.union([Issue, Commit, MergeRequest].map(&:link_reference_pattern))
+ link_patterns = Regexp.union([Issue, Commit, MergeRequest, Epic].map(&:link_reference_pattern).compact)
reference_pattern(link_patterns, issue_pattern)
end