Commit 0fc833ce88ba0ce5b5e33b1754c6c87561c7e791
1 parent
53767f1d
Exists in
master
and in
1 other branch
Fix plugin initialization
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
lib/merit/point_rules.rb
@@ -154,6 +154,8 @@ module Merit | @@ -154,6 +154,8 @@ module Merit | ||
154 | end | 154 | end |
155 | 155 | ||
156 | def self.setup | 156 | def self.setup |
157 | + return unless GamificationPlugin::PointsType.table_exists? && GamificationPlugin::PointsCategorization.table_exists? | ||
158 | + | ||
157 | AVAILABLE_RULES.map do |rule_name, rule| | 159 | AVAILABLE_RULES.map do |rule_name, rule| |
158 | point_type = GamificationPlugin::PointsType.find_by_name rule_name | 160 | point_type = GamificationPlugin::PointsType.find_by_name rule_name |
159 | point_type = GamificationPlugin::PointsType.create name: rule_name, description: rule['description'] if point_type.nil? | 161 | point_type = GamificationPlugin::PointsType.create name: rule_name, description: rule['description'] if point_type.nil? |