metamaps--metamaps/app/serializers/new_synapse_serializer.rb
2016-03-12 09:48:07 +11:00

19 lines
534 B
Ruby

class NewSynapseSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id,
:desc,
:category,
:weight,
:permission,
:created_at,
:updated_at
has_one :topic1, root: :topics, serializer: NewTopicSerializer
has_one :topic2, root: :topics, serializer: NewTopicSerializer
has_one :user, serializer: NewUserSerializer
#def filter(keys)
# keys.delete(:outcome_author) unless object.outcome_author.present?
# keys
#end
end