mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Use the same component for similar topics as search results.
This commit is contained in:
17
app/serializers/similar_topic_serializer.rb
Normal file
17
app/serializers/similar_topic_serializer.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class SimilarTopicSerializer < ApplicationSerializer
|
||||
|
||||
has_one :topic, serializer: TopicListItemSerializer, embed: :ids
|
||||
attributes :id, :blurb, :created_at
|
||||
|
||||
def id
|
||||
object.topic.id
|
||||
end
|
||||
|
||||
def blurb
|
||||
object.blurb
|
||||
end
|
||||
|
||||
def created_at
|
||||
object.topic.created_at
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user