2016-03-11 22:48:07 +00:00
|
|
|
class NewSynapseSerializer < ActiveModel::Serializer
|
2016-03-11 06:16:04 +00:00
|
|
|
embed :ids, include: true
|
|
|
|
attributes :id,
|
|
|
|
:desc,
|
|
|
|
:category,
|
|
|
|
:weight,
|
|
|
|
:permission,
|
|
|
|
:created_at,
|
|
|
|
:updated_at
|
|
|
|
|
2016-03-11 22:48:07 +00:00
|
|
|
has_one :topic1, root: :topics, serializer: NewTopicSerializer
|
|
|
|
has_one :topic2, root: :topics, serializer: NewTopicSerializer
|
|
|
|
has_one :user, serializer: NewUserSerializer
|
2016-03-11 06:16:04 +00:00
|
|
|
end
|