debian-mirror-gitlab/app/services/projects/participants_service.rb

23 lines
544 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2014-09-02 18:07:02 +05:30
module Projects
class ParticipantsService < BaseService
2018-10-15 14:42:47 +05:30
include Users::ParticipableService
2017-08-17 22:00:37 +05:30
2016-09-13 17:45:13 +05:30
def execute(noteable)
@noteable = noteable
participants = noteable_owner + participants_in_noteable + all_members + groups + project_members
2014-09-02 18:07:02 +05:30
participants.uniq
end
2018-11-08 19:23:39 +05:30
def project_members
@project_members ||= sorted(project.team.members)
end
2014-09-02 18:07:02 +05:30
def all_members
2018-11-08 19:23:39 +05:30
[{ username: "all", name: "All Project and Group Members", count: project_members.count }]
2014-09-02 18:07:02 +05:30
end
end
end