Commit 6577d3a4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Markdown now support users from groups

parent fdf7fc04
...@@ -68,6 +68,7 @@ class Project < ActiveRecord::Base ...@@ -68,6 +68,7 @@ class Project < ActiveRecord::Base
has_many :deploy_keys, through: :deploy_keys_projects has_many :deploy_keys, through: :deploy_keys_projects
delegate :name, to: :owner, allow_nil: true, prefix: true delegate :name, to: :owner, allow_nil: true, prefix: true
delegate :members, to: :team, prefix: true
# Validations # Validations
validates :creator, presence: true validates :creator, presence: true
......
...@@ -166,7 +166,7 @@ module Gitlab ...@@ -166,7 +166,7 @@ module Gitlab
end end
def reference_user(identifier) def reference_user(identifier)
if member = @project.users_projects.joins(:user).where(users: { username: identifier }).first if member = @project.team_members.find { |user| user.username == identifier }
link_to("@#{identifier}", user_path(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member link_to("@#{identifier}", user_path(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment