mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 08:05:59 +08:00
FIX: Missing url
attribute for suggested topics
This commit is contained in:
parent
6422d5efbd
commit
d7007207c9
@ -1,7 +1,7 @@
|
|||||||
class SimilarTopicSerializer < ApplicationSerializer
|
class SimilarTopicSerializer < ApplicationSerializer
|
||||||
|
|
||||||
has_one :topic, serializer: TopicListItemSerializer, embed: :ids
|
has_one :topic, serializer: TopicListItemSerializer, embed: :ids
|
||||||
attributes :id, :blurb, :created_at
|
attributes :id, :blurb, :created_at, :url
|
||||||
|
|
||||||
def id
|
def id
|
||||||
object.topic.id
|
object.topic.id
|
||||||
@ -11,6 +11,10 @@ class SimilarTopicSerializer < ApplicationSerializer
|
|||||||
object.blurb
|
object.blurb
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url
|
||||||
|
object.topic.url
|
||||||
|
end
|
||||||
|
|
||||||
def created_at
|
def created_at
|
||||||
object.topic.created_at
|
object.topic.created_at
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user