Commit 56f737fc713227c67683565c55977b05fc5b629c

Authored by Hugo Melo
1 parent b10edbe8

Create merit action to a_follower and friendship

Showing 1 changed file with 10 additions and 0 deletions   Show diff stats
script/process_merit_rules.rb
@@ -50,6 +50,11 @@ Environment.all.each do |environment| @@ -50,6 +50,11 @@ Environment.all.each do |environment|
50 article.comments.each.with_index(1) do |comment, i| 50 article.comments.each.with_index(1) do |comment, i|
51 create_action(comment, i, comment_count) 51 create_action(comment, i, comment_count)
52 end 52 end
  53 +
  54 + followed_articles_count = article.article_followers.count
  55 + article.article_followers.each_with_index do |af, i|
  56 + create_action(af, i, followed_articles_count)
  57 + end
53 end 58 end
54 59
55 environment.people.each.with_index(1) do |person, person_index| 60 environment.people.each.with_index(1) do |person, person_index|
@@ -57,6 +62,11 @@ Environment.all.each do |environment| @@ -57,6 +62,11 @@ Environment.all.each do |environment|
57 person.votes.each.with_index(1) do |vote, vote_index| 62 person.votes.each.with_index(1) do |vote, vote_index|
58 create_action(vote, vote_index, vote_count) 63 create_action(vote, vote_index, vote_count)
59 end 64 end
  65 +
  66 + friendship_count = person.friends.count
  67 + person.friends.each_with_index do |friend, index|
  68 + create_action(friend, index, friendship_count)
  69 + end
60 end 70 end
61 71
62 environment.people.each.with_index(1) do |person, person_index| 72 environment.people.each.with_index(1) do |person, person_index|