Commit 632d06f901cd284c7b4dd5d8482696a8657f0c0c
1 parent
eb0257c2
Exists in
master
and in
18 other branches
product_category: filter distinct (fix test)
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/product_category.rb
@@ -7,7 +7,7 @@ class ProductCategory < Category | @@ -7,7 +7,7 @@ class ProductCategory < Category | ||
7 | 7 | ||
8 | scope :unique, :select => 'DISTINCT ON (path) categories.*' | 8 | scope :unique, :select => 'DISTINCT ON (path) categories.*' |
9 | scope :by_enterprise, -> enterprise { | 9 | scope :by_enterprise, -> enterprise { |
10 | - joins(:products). | 10 | + distinct.joins(:products). |
11 | where('products.profile_id = ?', enterprise.id) | 11 | where('products.profile_id = ?', enterprise.id) |
12 | } | 12 | } |
13 | scope :by_environment, -> environment { | 13 | scope :by_environment, -> environment { |