2014-06-23 09:44:49 -04:00
|
|
|
module Projects
|
|
|
|
class ParticipantsService < BaseService
|
2018-04-26 15:53:13 -04:00
|
|
|
include Users::ParticipableService
|
2016-10-13 13:40:06 -04:00
|
|
|
|
2016-08-12 21:17:18 -04:00
|
|
|
def execute(noteable)
|
|
|
|
@noteable = noteable
|
2016-08-12 05:19:29 -04:00
|
|
|
|
2016-08-12 21:17:18 -04:00
|
|
|
participants = noteable_owner + participants_in_noteable + all_members + groups + project_members
|
2014-06-23 09:44:49 -04:00
|
|
|
participants.uniq
|
|
|
|
end
|
|
|
|
|
2018-05-29 05:34:24 -04:00
|
|
|
def project_members
|
|
|
|
@project_members ||= sorted(project.team.members)
|
|
|
|
end
|
|
|
|
|
2014-06-23 09:44:49 -04:00
|
|
|
def all_members
|
2018-05-29 05:34:24 -04:00
|
|
|
[{ username: "all", name: "All Project and Group Members", count: project_members.count }]
|
2014-06-23 09:44:49 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|