1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-28 09:24:24 +01:00

(bug) show product count is only active in category

This commit is contained in:
Du Peng 2022-10-20 18:23:30 +02:00
parent 9eeef449ab
commit 5804b6230d

View File

@ -4,7 +4,7 @@
class ProductCategoryService
def self.list
ProductCategory.left_outer_joins(:products)
.select('product_categories.*, count(products.*) as products_count')
.select('product_categories.*, count(products.*) filter (where is_active is true) as products_count')
.group('product_categories.id')
end