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

19 lines
510 B
Ruby
Raw Normal View History

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
2015-04-26 12:48:37 +05:30
project_members = sorted(project.team.members)
2016-09-13 17:45:13 +05:30
participants = noteable_owner + participants_in_noteable + all_members + groups + project_members
2014-09-02 18:07:02 +05:30
participants.uniq
end
def all_members
2015-04-26 12:48:37 +05:30
count = project.team.members.flatten.count
2015-09-11 14:41:01 +05:30
[{ username: "all", name: "All Project and Group Members", count: count }]
2014-09-02 18:07:02 +05:30
end
end
end