This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/serializers/similar_topic_serializer.rb

22 lines
331 B
Ruby

class SimilarTopicSerializer < ApplicationSerializer
has_one :topic, serializer: TopicListItemSerializer, embed: :ids
attributes :id, :blurb, :created_at, :url
def id
object.topic.id
end
def blurb
object.blurb
end
def url
object.topic.url
end
def created_at
object.topic.created_at
end
end