mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: show the draft on top page
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
class TopListSerializer < ApplicationSerializer
|
||||
|
||||
attribute :can_create_topic
|
||||
attributes :can_create_topic,
|
||||
:draft,
|
||||
:draft_key,
|
||||
:draft_sequence
|
||||
|
||||
def can_create_topic
|
||||
scope.can_create?(Topic)
|
||||
@@ -10,7 +13,7 @@ class TopListSerializer < ApplicationSerializer
|
||||
attribute period
|
||||
|
||||
define_method(period) do
|
||||
TopicListSerializer.new(object[period], scope: scope).as_json if object[period]
|
||||
TopicListSerializer.new(object.send(period), scope: scope).as_json if object.send(period)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user