BUGFIX: show the draft on top page

This commit is contained in:
Régis Hanol
2014-02-06 11:39:43 +01:00
parent a710773bb4
commit 58202baa62
5 changed files with 36 additions and 5 deletions

View File

@@ -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