mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Improve category filtering and include subcategories
* category_filtering 1. report_top_referred_topics 2. report_top_traffic_sources 3. report_post_edit * category_filtering with subcategory topics 1. report_top_referred_topics 2. report_top_traffic_sources 3. report_post_edit 4. report_posts 5. report_topics 6. report_topics_with_no_response * category_filtering tests (without subcategory topics) 1. report_posts 2. report_topics_with_no_response * subcategory topics tests `in_category_and_subcategories` in `topic_spec.rb` 1. `in_category_and_subcategories` in `topic_spec.rb` 2. topics, posts, flags and topics_with_no_response in `report_spec.rb`
This commit is contained in:
@@ -143,7 +143,7 @@ class PostAction < ActiveRecord::Base
|
||||
result = unscoped.where(post_action_type_id: post_action_type)
|
||||
result = result.where('post_actions.created_at >= ?', opts[:start_date] || (opts[:since_days_ago] || 30).days.ago)
|
||||
result = result.where('post_actions.created_at <= ?', opts[:end_date]) if opts[:end_date]
|
||||
result = result.joins(post: :topic).where('topics.category_id = ?', opts[:category_id]) if opts[:category_id]
|
||||
result = result.joins(post: :topic).merge(Topic.in_category_and_categories(opts[:category_id])) if opts[:category_id]
|
||||
result.group('date(post_actions.created_at)')
|
||||
.order('date(post_actions.created_at)')
|
||||
.count
|
||||
|
||||
Reference in New Issue
Block a user