gab-social/app/presenters/group_relationships_presenter.rb
mgabdev ac9b9e8448 Added new role for moderator to Groups
• Added:
- new role for moderator to Groups
2020-09-02 18:06:38 -05:00

15 lines
533 B
Ruby

# frozen_string_literal: true
class GroupRelationshipsPresenter
attr_reader :member, :admin, :moderator
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
@member = Group.member_map(@group_ids, @current_account_id)
@admin = Group.admin_map(@group_ids, @current_account_id)
@moderator = Group.moderator_map(@group_ids, @current_account_id)
end
end