discourse/app/serializers/similar_topic_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
361 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
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