diff --git a/db/migrate/20150930132305_move_points_category_to_categorization_tables.rb b/db/migrate/20150930132305_move_points_category_to_categorization_tables.rb index ab642c4..67994b9 100644 --- a/db/migrate/20150930132305_move_points_category_to_categorization_tables.rb +++ b/db/migrate/20150930132305_move_points_category_to_categorization_tables.rb @@ -7,13 +7,13 @@ class MovePointsCategoryToCategorizationTables < ActiveRecord::Migration settings = Noosfero::Plugin::Settings.new(env, GamificationPlugin) weight = settings.settings.fetch(:point_rules, {}).fetch(name.to_s, {}).fetch('weight', setting[:default_weight]).to_i cat = GamificationPlugin::PointsCategorization.create(point_type_id: type.id, weight: weight) - Merit::Score.update_all "category = '#{cat.id}'", category: name + Merit::Score.where(category: name).update_all(category: cat.id.to_s) end end def down GamificationPlugin::PointsCategorization.all.each do |categorization| - Merit::Score.update_all "category = '#{categorization.point_type.name}'", category: categorization.id.to_s + Merit::Score.where(category: categorization.id.to_s).update_all(category: categorization.point_type.name) categorization.point_type.destroy categorization.destroy end -- libgit2 0.21.2