From 632d06f901cd284c7b4dd5d8482696a8657f0c0c Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sat, 12 Dec 2015 13:48:55 -0300 Subject: [PATCH] product_category: filter distinct (fix test) --- app/models/product_category.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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