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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
661 B
Ruby
Raw Permalink Normal View History

2021-06-08 01:23:25 +05:30
# frozen_string_literal: true
module Groups
class ParticipantsService < Groups::BaseService
include Users::ParticipableService
def execute(noteable)
@noteable = noteable
participants =
noteable_owner +
participants_in_noteable +
all_members +
groups +
group_members
render_participants_as_hash(participants.uniq)
end
def all_members
count = group_members.count
[{ username: "all", name: "All Group Members", count: count }]
end
def group_members
2021-09-04 01:27:46 +05:30
return [] unless group
2021-06-08 01:23:25 +05:30
2021-09-04 01:27:46 +05:30
@group_members ||= sorted(group.direct_and_indirect_users)
2021-06-08 01:23:25 +05:30
end
end
end