diff options
author | Sean McGivern <sean@gitlab.com> | 2018-08-29 14:38:42 +0100 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-09-17 19:36:53 +0800 |
commit | 9357585ecacacfa0618b4f4172d5ea7dd0b1c5ae (patch) | |
tree | a2fb60da46404df95705f2ce9f6a1be49cfa47aa /app/models/concerns/mentionable | |
parent | 896c89e71dcc19d742f8609ed7f81c765c399c8e (diff) | |
download | gitlab-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.rb | 12 |
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 |