gab-social/app/serializers/rest/group_relationship_serializer.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

23 lines
457 B
Ruby

# frozen_string_literal: true
class REST::GroupRelationshipSerializer < ActiveModel::Serializer
attributes :id, :member, :admin, :moderator
def id
object.id.to_s
end
def member
instance_options[:relationships].member[object.id] ? true : false
end
def admin
instance_options[:relationships].admin[object.id] ? true : false
end
def moderator
instance_options[:relationships].moderator[object.id] ? true : false
end
end