2019-07-02 08:10:25 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::GroupRelationshipSerializer < ActiveModel::Serializer
|
2020-05-10 04:57:38 +01:00
|
|
|
attributes :id, :member, :admin
|
2019-07-02 08:10:25 +01:00
|
|
|
|
|
|
|
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
|
2019-07-20 00:04:08 +01:00
|
|
|
|
2019-07-02 08:10:25 +01:00
|
|
|
end
|