mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-09 16:20:09 +09:00
18 lines
317 B
Ruby
18 lines
317 B
Ruby
module Message::Mentionee
|
|
extend ActiveSupport::Concern
|
|
|
|
def mentionees
|
|
ids = mentioned_users.map(&:id)
|
|
ids.empty? ? User.none : room.users.where(id: ids)
|
|
end
|
|
|
|
private
|
|
def mentioned_users
|
|
if body.body
|
|
body.body.attachables.grep(User).uniq
|
|
else
|
|
[]
|
|
end
|
|
end
|
|
end
|