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 50 article.comments.each.with_index(1) do |comment, i|
51 51 create_action(comment, i, comment_count)
52 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 58 end
54 59  
55 60 environment.people.each.with_index(1) do |person, person_index|
... ... @@ -57,6 +62,11 @@ Environment.all.each do |environment|
57 62 person.votes.each.with_index(1) do |vote, vote_index|
58 63 create_action(vote, vote_index, vote_count)
59 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 70 end
61 71  
62 72 environment.people.each.with_index(1) do |person, person_index|
... ...