diff --git a/app/models/product_category.rb b/app/models/product_category.rb index 4039b88..901df33 100644 --- a/app/models/product_category.rb +++ b/app/models/product_category.rb @@ -7,7 +7,7 @@ class ProductCategory < Category scope :unique, :select => 'DISTINCT ON (path) categories.*' scope :by_enterprise, -> enterprise { - joins(:products). + distinct.joins(:products). where('products.profile_id = ?', enterprise.id) } scope :by_environment, -> environment { -- libgit2 0.21.2