mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-26 09:08:32 -05:00
21 lines
331 B
Ruby
21 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
|