gitlab-org--gitlab-foss/app/services/projects/participants_service.rb

21 lines
513 B
Ruby
Raw Normal View History

module Projects
class ParticipantsService < BaseService
include Users::ParticipableService
2016-08-12 21:17:18 -04:00
def execute(noteable)
@noteable = noteable
2016-08-12 21:17:18 -04:00
participants = noteable_owner + participants_in_noteable + all_members + groups + project_members
participants.uniq
end
def project_members
@project_members ||= sorted(project.team.members)
end
def all_members
[{ username: "all", name: "All Project and Group Members", count: project_members.count }]
end
end
end