Commit 7c473e444e059f34989071c5e005f92d1be5f243
1 parent
56f737fc
Exists in
master
and in
1 other branch
Process profile merit actions also
Showing
1 changed file
with
6 additions
and
3 deletions
Show diff stats
script/process_merit_rules.rb
@@ -24,11 +24,11 @@ end | @@ -24,11 +24,11 @@ end | ||
24 | 24 | ||
25 | #puts "Destroy all merit actions" | 25 | #puts "Destroy all merit actions" |
26 | #Merit::Action.destroy_all | 26 | #Merit::Action.destroy_all |
27 | -# | 27 | + |
28 | #count = Person.count | 28 | #count = Person.count |
29 | #Person.all.each.with_index(1) do |person, i| | 29 | #Person.all.each.with_index(1) do |person, i| |
30 | -# puts "#{i}/#{count} Remove sash from #{person.identifier}" | ||
31 | -# person.sash.destroy unless person.sash.nil? | 30 | + #puts "#{i}/#{count} Remove sash from #{person.identifier}" |
31 | + #person.sash.destroy unless person.sash.nil? | ||
32 | #end | 32 | #end |
33 | 33 | ||
34 | Merit.observers << 'ProcessObserver' | 34 | Merit.observers << 'ProcessObserver' |
@@ -57,7 +57,10 @@ Environment.all.each do |environment| | @@ -57,7 +57,10 @@ Environment.all.each do |environment| | ||
57 | end | 57 | end |
58 | end | 58 | end |
59 | 59 | ||
60 | + people_count = environment.people.count | ||
60 | environment.people.each.with_index(1) do |person, person_index| | 61 | environment.people.each.with_index(1) do |person, person_index| |
62 | + create_action(person, person_index, people_count) | ||
63 | + | ||
61 | vote_count = person.votes.count | 64 | vote_count = person.votes.count |
62 | person.votes.each.with_index(1) do |vote, vote_index| | 65 | person.votes.each.with_index(1) do |vote, vote_index| |
63 | create_action(vote, vote_index, vote_count) | 66 | create_action(vote, vote_index, vote_count) |