Commit 811601697974ef5fe4236d0e828403a99f95c6da
Committed by
Macartur Sousa
1 parent
f8d34f0c
Exists in
elasticsearch_api
should not looks for products with products plugin activated
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
plugins/statistics/lib/statistics_block.rb
@@ -93,6 +93,7 @@ class StatisticsBlock < Block | @@ -93,6 +93,7 @@ class StatisticsBlock < Block | ||
93 | end | 93 | end |
94 | 94 | ||
95 | def products | 95 | def products |
96 | + return [] unless environment.plugin_enabled?('ProductsPlugin') | ||
96 | if owner.kind_of?(Environment) | 97 | if owner.kind_of?(Environment) |
97 | owner.products.where("profiles.enabled = true and profiles.visible = true").count | 98 | owner.products.where("profiles.enabled = true and profiles.visible = true").count |
98 | elsif owner.kind_of?(Enterprise) | 99 | elsif owner.kind_of?(Enterprise) |