diff --git a/script/process_merit_rules.rb b/script/process_merit_rules.rb index db7e624..e338a4c 100755 --- a/script/process_merit_rules.rb +++ b/script/process_merit_rules.rb @@ -28,14 +28,16 @@ def create_action(obj, index, count) end end -#puts "Destroy all merit actions" -#Merit::Action.destroy_all -# -#count = Person.count -#Person.all.each.with_index(1) do |person, i| -# puts "#{i}/#{count} Remove sash from #{person.identifier}" -# person.sash.destroy unless person.sash.nil? -#end +if ARGV.length>0 && ARGV[0] == 'destroy_old' + puts "Destroy all merit actions" + Merit::Action.destroy_all + + count = Person.count + Person.all.each.with_index(1) do |person, i| + puts "#{i}/#{count} Remove sash from #{person.identifier}" + person.sash.destroy unless person.sash.nil? + end +end # avoid updating level on every action for increasing performance Merit.observers.delete('RankObserver') -- libgit2 0.21.2