Commit b9787919422f1ca434c15fb0ac19e5f8fef8615e

Authored by Victor Costa
1 parent 3c1d3d84

Fix badge rules verification

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
lib/merit/badge_rules.rb
@@ -36,7 +36,7 @@ module Merit @@ -36,7 +36,7 @@ module Merit
36 environment.gamification_plugin_badges.all.each do |badge| 36 environment.gamification_plugin_badges.all.each do |badge|
37 setting = AVAILABLE_RULES[badge.name.to_sym] 37 setting = AVAILABLE_RULES[badge.name.to_sym]
38 grant_on setting[:action], :badge => badge.name, :level => badge.level, :to => setting[:to] do |source| 38 grant_on setting[:action], :badge => badge.name, :level => badge.level, :to => setting[:to] do |source|
39 - setting[:value].call(source) >= (badge.custom_fields || {}).fetch(:threshold, setting[:default_threshold]) 39 + setting[:value].call(source) >= (badge.custom_fields || {}).fetch(:threshold, setting[:default_threshold]).to_i
40 end 40 end
41 end 41 end
42 end 42 end