mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 12:53:44 +08:00
e733701887
This commit also adds 'include subcategories' report filter
13 lines
499 B
Ruby
13 lines
499 B
Ruby
# frozen_string_literal: true
|
|
|
|
Report.add_report('topics') do |report|
|
|
category_id, include_subcategories = report.add_category_filter
|
|
|
|
basic_report_about report, Topic, :listable_count_per_day, report.start_date, report.end_date, category_id, include_subcategories
|
|
|
|
countable = Topic.listable_topics
|
|
countable = countable.where(category_id: include_subcategories ? Category.subcategory_ids(category_id) : category_id) if category_id
|
|
|
|
add_counts report, countable, 'topics.created_at'
|
|
end
|