Commit 34560e6e8dbe1cd5b7f90a096b7475bc06031f8b

Authored by MoisesMachado
1 parent 8ae01dc6

ActionItem501: fixed the load of the rigth categories for little icons


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2245 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/models/environment_finder.rb
... ... @@ -29,7 +29,7 @@ class EnvironmentFinder
29 29 if product_category && asset == :products
30 30 @environment.send(asset).send(finder_method, :all, options.merge(:include => 'product_categorizations', :conditions => ['product_categorizations.category_id = (?)', product_category.id]))
31 31 elsif product_category && asset == :enterprises
32   - @environment.send(asset).send(finder_method, :all, options.merge(:order => 'profiles.name', :include => 'products', :joins => 'inner join product_categorizations on (product_categorizations.product_id = products.id)', :conditions => ['product_categorizations.category_id = (?)', product_category.id]))
  32 + @environment.send(asset).send(finder_method, :all, options.merge( :order => 'profiles.name', :joins => 'inner join products on (products.enterprise_id = profiles.id) inner join product_categorizations on (product_categorizations.product_id = products.id)', :conditions => ['product_categorizations.category_id = (?)', product_category.id]))
33 33 else
34 34 if (asset == :events) && date_range
35 35 @environment.send(asset).send(finder_method, :all, options.merge(:conditions => { :start_date => date_range}))
... ...