Commit edf20ef2f294091351e8cc338d11373f9ebe9b44
1 parent
c7284557
Exists in
master
check if gamification plugin is enabled
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
lib/ext/entities.rb
... | ... | @@ -8,15 +8,15 @@ module Noosfero |
8 | 8 | expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia, :membro_conselho |
9 | 9 | |
10 | 10 | expose :points do |person, options| |
11 | - person.points if person.respond_to?(:points) | |
11 | + person.points if person.environment.plugin_enabled?('GamificationPlugin') | |
12 | 12 | end |
13 | 13 | |
14 | 14 | expose :level do |person, options| |
15 | - person.level if person.respond_to?(:level) | |
15 | + person.level if person.environment.plugin_enabled?('GamificationPlugin') | |
16 | 16 | end |
17 | 17 | |
18 | 18 | expose :gamification_plugin_level_percent do |person, options| |
19 | - person.gamification_plugin_level_percent if person.respond_to?(:gamification_plugin_level_percent) | |
19 | + person.gamification_plugin_level_percent if person.environment.plugin_enabled?('GamificationPlugin') | |
20 | 20 | end |
21 | 21 | |
22 | 22 | end | ... | ... |