2019-07-02 08:10:25 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class GroupRelationshipsPresenter
|
2020-09-10 23:07:00 +01:00
|
|
|
attr_reader :member, :admin, :moderator, :requested
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
def initialize(group_ids, current_account_id, **options)
|
|
|
|
@group_ids = group_ids.map { |a| a.is_a?(Group) ? a.id : a }
|
|
|
|
@current_account_id = current_account_id
|
|
|
|
|
2019-07-22 03:45:58 +01:00
|
|
|
@member = Group.member_map(@group_ids, @current_account_id)
|
|
|
|
@admin = Group.admin_map(@group_ids, @current_account_id)
|
2020-09-03 00:06:38 +01:00
|
|
|
@moderator = Group.moderator_map(@group_ids, @current_account_id)
|
2020-09-10 23:07:00 +01:00
|
|
|
@requested = Group.requested_map(@group_ids, @current_account_id)
|
2019-07-02 08:10:25 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|