discourse/app/serializers/top_list_serializer.rb
2014-01-14 01:09:12 +01:00

13 lines
242 B
Ruby

class TopListSerializer < ApplicationSerializer
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