Commit 632d06f901cd284c7b4dd5d8482696a8657f0c0c

Authored by Braulio Bhavamitra
1 parent eb0257c2

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  
8 8 scope :unique, :select => 'DISTINCT ON (path) categories.*'
9 9 scope :by_enterprise, -> enterprise {
10   - joins(:products).
  10 + distinct.joins(:products).
11 11 where('products.profile_id = ?', enterprise.id)
12 12 }
13 13 scope :by_environment, -> environment {
... ...