discourse/app/serializers/top_list_serializer.rb
Régis Hanol 129617b415 Lots of bugfixes
BUGFIX: navigation bar should always activate the right tab (even when diging into a top period)
BUGFIX: /top pages titles
BUGFIX: no "edit category" button on /top page after visiting a category
BUGFIX: properly hide category columns when there is no children category (on both filter + top pages)
BUGFIX: promises not caught when scrolling down a topic list to load more of them
BUGFIX: CSS on category dropdowns
Updated `top_menu` i18n with available filters
2014-01-18 19:27:25 +01:00

18 lines
332 B
Ruby

class TopListSerializer < ApplicationSerializer
attribute :can_create_topic
def can_create_topic
scope.can_create?(Topic)
end
TopTopic.periods.each do |period|
attribute period
define_method(period) do
TopicListSerializer.new(object[period], scope: scope).as_json if object[period]
end
end
end