gab-social/app/presenters/group_relationships_presenter.rb

14 lines
446 B
Ruby
Raw Normal View History

2019-07-02 03:10:25 -04:00
# frozen_string_literal: true
class GroupRelationshipsPresenter
2020-05-09 23:57:38 -04:00
attr_reader :member, :admin
2019-07-02 03:10:25 -04: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 05:45:58 +03:00
@member = Group.member_map(@group_ids, @current_account_id)
@admin = Group.admin_map(@group_ids, @current_account_id)
2019-07-02 03:10:25 -04:00
end
end