diff --git a/db/migrate/20151003000212_move_badge_threshold_to_action_key.rb b/db/migrate/20151003000212_move_badge_threshold_to_action_key.rb index 24d3736..6942bd5 100644 --- a/db/migrate/20151003000212_move_badge_threshold_to_action_key.rb +++ b/db/migrate/20151003000212_move_badge_threshold_to_action_key.rb @@ -6,6 +6,7 @@ class MoveBadgeThresholdToActionKey < ActiveRecord::Migration GamificationPlugin::Badge.all.each do |badge| next if Merit::BadgeRules::AVAILABLE_RULES[badge.name.to_sym].nil? Merit::BadgeRules::AVAILABLE_RULES[badge.name.to_sym].each do |setting| + badge.custom_fields = {} unless badge.custom_fields.is_a? Hash badge.custom_fields[setting[:action]] = {threshold: badge.custom_fields[:threshold]} unless badge.custom_fields[:threshold].nil? badge.save end -- libgit2 0.21.2