FIX: Include subcategories in report (#86)
This commit is contained in:
parent
329d8aff30
commit
dafb1d7c7f
|
@ -317,11 +317,11 @@ SQL
|
||||||
category_filter = report.filters.dig(:category)
|
category_filter = report.filters.dig(:category)
|
||||||
report.add_filter('category', default: category_filter)
|
report.add_filter('category', default: category_filter)
|
||||||
if category_filter
|
if category_filter
|
||||||
accepted_solutions = accepted_solutions.joins(:topic).where("topics.category_id = ?", category_filter)
|
accepted_solutions = accepted_solutions.joins(:topic).where("topics.category_id IN (?)", Category.subcategory_ids(category_filter.to_i))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if report.category_id
|
if report.category_id
|
||||||
accepted_solutions = accepted_solutions.joins(:topic).where("topics.category_id = ?", report.category_id)
|
accepted_solutions = accepted_solutions.joins(:topic).where("topics.category_id IN (?)", Category.subcategory_ids(report.category_id.to_i))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue