[Git][noosfero/noosfero][master] product_category: filter distinct (fix test)

Bráulio Bhavamitra gitlab at mg.gitlab.com
Sat Dec 12 14:49:39 BRST 2015


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
632d06f9 by Braulio Bhavamitra at 2015-12-12T13:48:55Z
product_category: filter distinct (fix test)

- - - - -


1 changed file:

- app/models/product_category.rb


Changes:

=====================================
app/models/product_category.rb
=====================================
--- 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 {



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/632d06f901cd284c7b4dd5d8482696a8657f0c0c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20151212/8c7e92d4/attachment.html>


More information about the Noosfero-dev mailing list