gab-social/app/serializers/rest/group_relationship_serializer.rb

18 lines
348 B
Ruby
Raw Normal View History

2019-07-02 08:10:25 +01:00
# 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