summaryrefslogtreecommitdiff
path: root/lib/gitlab/reference_extractor.rb
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2015-12-17 16:08:14 -0600
committerDrew Blessing <drew@gitlab.com>2015-12-18 14:19:48 -0600
commitf177aaa5fa789654dc440d6ec4ae3546544c1401 (patch)
tree709b259ea7903da9ac28e5393cc29d0780a6c63a /lib/gitlab/reference_extractor.rb
parent27859f7ed9e1efe98b8386844d0a7e69fd58277a (diff)
downloadgitlab-ce-f177aaa5fa789654dc440d6ec4ae3546544c1401.tar.gz
Backport JIRA service
Diffstat (limited to 'lib/gitlab/reference_extractor.rb')
-rw-r--r--lib/gitlab/reference_extractor.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb
index 42f7c26f3c4..0a70d21b1ce 100644
--- a/lib/gitlab/reference_extractor.rb
+++ b/lib/gitlab/reference_extractor.rb
@@ -18,10 +18,20 @@ module Gitlab
super(text, context.merge(project: project))
end
- %i(user label issue merge_request snippet commit commit_range).each do |type|
+ %i(user label merge_request snippet commit commit_range).each do |type|
define_method("#{type}s") do
@references[type] ||= references(type, project: project, current_user: current_user)
end
end
+
+ def issues
+ options = { project: project, current_user: current_user }
+
+ if project && project.jira_tracker?
+ @references[:external_issue] ||= references(:external_issue, options)
+ else
+ @references[:issue] ||= references(:issue, options)
+ end
+ end
end
end