diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-15 17:34:37 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2019-03-18 14:40:09 +0100 |
commit | 3eee0426c5bee0edd5d65291e2ea32a02b906792 (patch) | |
tree | 2406ff8df44097d64123d2674146ffc25e784623 /lib | |
parent | 96eefa7f28c189d308ec2bf129fec4d048f35edc (diff) | |
download | gitlab-ce-3eee0426c5bee0edd5d65291e2ea32a02b906792.tar.gz |
Backport EE changes to UserExtractor to CE
This backports the changes EE made to Gitlab::UserExtractor, removing
the need for an EE specific module.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/user_extractor.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/user_extractor.rb b/lib/gitlab/user_extractor.rb index 874599688bb..f0557f6ad68 100644 --- a/lib/gitlab/user_extractor.rb +++ b/lib/gitlab/user_extractor.rb @@ -11,11 +11,14 @@ module Gitlab USERNAME_REGEXP = User.reference_pattern def initialize(text) - @text = text + # EE passes an Array to `text` in a few places, so we want to support both + # here. + @text = Array(text).join(' ') end def users return User.none unless @text.present? + return User.none if references.empty? @users ||= User.from_union(union_relations) end |