summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-27 11:37:45 +0100
committerDouwe Maan <douwe@gitlab.com>2015-04-02 10:53:38 +0200
commitb1ef1aa59f5ccb78be6d2462b56ed6bafebe65c0 (patch)
tree432109a5a23dca4092410b24f518d72a6e07dc7a /app/models/concerns
parent254698d6b8628b5ce57597526d6b34f332c22903 (diff)
downloadgitlab-ce-b1ef1aa59f5ccb78be6d2462b56ed6bafebe65c0.tar.gz
Slightly refactor ReferenceExtractor.
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/mentionable.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb
index d96e07034ec..52eb87d1dbc 100644
--- a/app/models/concerns/mentionable.rb
+++ b/app/models/concerns/mentionable.rb
@@ -65,12 +65,10 @@ module Mentionable
# Extract GFM references to other Mentionables from this Mentionable. Always excludes its #local_reference.
def references(p = project, text = mentionable_text)
return [] if text.blank?
- ext = Gitlab::ReferenceExtractor.new
- ext.analyze(text, p)
+ ext = Gitlab::ReferenceExtractor.new(p)
+ ext.analyze(text)
- (ext.issues_for(p) +
- ext.merge_requests_for(p) +
- ext.commits_for(p)).uniq - [local_reference]
+ (ext.issues + ext.merge_requests + ext.commits).uniq - [local_reference]
end
# Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+.