Commit 626359831402aeede4c4cb12cb10c7534a0dae79

Authored by Dmitriy Zaporozhets
1 parent a8cb13c8

Respect group members in mentionable concern

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/concerns/mentionable.rb
... ... @@ -50,7 +50,7 @@ module Mentionable
50 50 matches.each do |match|
51 51 identifier = match.delete "@"
52 52 if has_project
53   - id = project.users_projects.joins(:user).where(users: { username: identifier }).pluck(:user_id).first
  53 + id = project.team.members.find { |u| u.username == identifier }.try(:id)
54 54 else
55 55 id = User.where(username: identifier).pluck(:id).first
56 56 end
... ...