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:
parent
9eeef449ab
commit
5804b6230d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user