gab-social/app/serializers/rest/group_relationship_serializer.rb
2020-05-11 23:34:18 -04:00

19 lines
349 B
Ruby

# frozen_string_literal: true
class REST::GroupRelationshipSerializer < ActiveModel::Serializer
attributes :id, :member, :admin
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
end