From edf20ef2f294091351e8cc338d11373f9ebe9b44 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Tue, 20 Oct 2015 11:06:47 -0300 Subject: [PATCH] check if gamification plugin is enabled --- lib/ext/entities.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ext/entities.rb b/lib/ext/entities.rb index 1d1021e..8db5daf 100644 --- a/lib/ext/entities.rb +++ b/lib/ext/entities.rb @@ -8,15 +8,15 @@ module Noosfero expose :orientacao_sexual, :identidade_genero, :transgenero, :etnia, :membro_conselho expose :points do |person, options| - person.points if person.respond_to?(:points) + person.points if person.environment.plugin_enabled?('GamificationPlugin') end expose :level do |person, options| - person.level if person.respond_to?(:level) + person.level if person.environment.plugin_enabled?('GamificationPlugin') end expose :gamification_plugin_level_percent do |person, options| - person.gamification_plugin_level_percent if person.respond_to?(:gamification_plugin_level_percent) + person.gamification_plugin_level_percent if person.environment.plugin_enabled?('GamificationPlugin') end end -- libgit2 0.21.2