[Git][noosfero/noosfero][master] should not looks for products with products plugin activated

Leandro Nunes gitlab at mg.gitlab.com
Thu May 19 15:13:34 BRT 2016


Leandro Nunes pushed to branch master at Noosfero / noosfero


Commits:
4690053a by Leandro Nunes dos Santos at 2016-05-19T15:13:12-03:00
should not looks for products with products plugin activated

- - - - -


1 changed file:

- plugins/statistics/lib/statistics_block.rb


Changes:

=====================================
plugins/statistics/lib/statistics_block.rb
=====================================
--- a/plugins/statistics/lib/statistics_block.rb
+++ b/plugins/statistics/lib/statistics_block.rb
@@ -93,6 +93,7 @@ class StatisticsBlock < Block
   end
 
   def products
+    return [] unless environment.plugin_enabled?('ProductsPlugin')
     if owner.kind_of?(Environment)
       owner.products.where("profiles.enabled = true and profiles.visible = true").count
     elsif owner.kind_of?(Enterprise)



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/4690053a5592b2a94006395609e7913903e16e16
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160519/b8cb2d2b/attachment.html>


More information about the Noosfero-dev mailing list