From 56f737fc713227c67683565c55977b05fc5b629c Mon Sep 17 00:00:00 2001 From: Hugo Melo Date: Mon, 19 Oct 2015 20:43:30 -0200 Subject: [PATCH] Create merit action to a_follower and friendship --- script/process_merit_rules.rb | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/script/process_merit_rules.rb b/script/process_merit_rules.rb index 030fdb7..1341c9e 100755 --- a/script/process_merit_rules.rb +++ b/script/process_merit_rules.rb @@ -50,6 +50,11 @@ Environment.all.each do |environment| article.comments.each.with_index(1) do |comment, i| create_action(comment, i, comment_count) end + + followed_articles_count = article.article_followers.count + article.article_followers.each_with_index do |af, i| + create_action(af, i, followed_articles_count) + end end environment.people.each.with_index(1) do |person, person_index| @@ -57,6 +62,11 @@ Environment.all.each do |environment| person.votes.each.with_index(1) do |vote, vote_index| create_action(vote, vote_index, vote_count) end + + friendship_count = person.friends.count + person.friends.each_with_index do |friend, index| + create_action(friend, index, friendship_count) + end end environment.people.each.with_index(1) do |person, person_index| -- libgit2 0.21.2