mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 16:20:09 +09:00
Avoid room queries for messages without mentions
This commit is contained in:
@@ -2,7 +2,8 @@ module Message::Mentionee
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def mentionees
|
||||
room.users.where(id: mentioned_users.map(&:id))
|
||||
ids = mentioned_users.map(&:id)
|
||||
ids.empty? ? User.none : room.users.where(id: ids)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user