From 9b13ce0b7a50e65dfba31d4865a728c725daa3fe Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 18 Mar 2016 14:48:55 +0100 Subject: Improvements in issue move feaure (refactoring) According to endbosses' suggestions. --- lib/gitlab/reference_extractor.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/gitlab/reference_extractor.rb') diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb index 8c698d43bef..13c4d64c99b 100644 --- a/lib/gitlab/reference_extractor.rb +++ b/lib/gitlab/reference_extractor.rb @@ -37,6 +37,16 @@ module Gitlab @references.values.flatten end + def self.references_pattern + return @pattern if @pattern + + patterns = REFERABLES.map do |ref| + ref.to_s.classify.constantize.try(:reference_pattern) + end + + @pattern = Regexp.union(patterns.compact) + end + private def reference_context -- cgit v1.2.1