diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-06 16:45:37 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-06 16:45:37 -0800 |
commit | 89f8020fe12e16faf125a193b25a0eeaea3b49c0 (patch) | |
tree | b176949c60b4bd25e36b70a96f5dfc6cdcf4f0ef /lib | |
parent | 8c4b98bec79e02613924db853deadd5af4ff0e15 (diff) | |
parent | 04a70d9ff7c8132bfd01ebf4d10fd34745719833 (diff) | |
download | gitlab-ce-89f8020fe12e16faf125a193b25a0eeaea3b49c0.tar.gz |
Merge branch 'mention-groups'
Conflicts:
CHANGELOG
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/markdown.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index c0e83fb3078..78627f413c2 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -202,8 +202,15 @@ module Gitlab if identifier == "all" link_to("@all", project_url(project), options) - elsif User.find_by(username: identifier) - link_to("@#{identifier}", user_url(identifier), options) + elsif namespace = Namespace.find_by(path: identifier) + url = + if namespace.type == "Group" + group_url(identifier) + else + user_url(identifier) + end + + link_to("@#{identifier}", url, options) end end |