Commit 181aa2b9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

More efficient query for mentionable users

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 0cedd703
......@@ -50,7 +50,7 @@ module Mentionable
matches.each do |match|
identifier = match.delete "@"
if has_project
id = project.team.members.find { |u| u.username == identifier }.try(:id)
id = project.team.members.find_by(username: identifier).try(:id)
else
id = User.where(username: identifier).pluck(:id).first
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