mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 19:08:10 -05:00
12 lines
242 B
Ruby
12 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
|