Skip to content

Commit

Permalink
Reset votes when a news goes back to redaction
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jun 7, 2012
1 parent cf944b8 commit ba0fc41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/news.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def be_refused
end

def be_rewritten
%w(pour contre).each {|word| $redis.del("news/#{self.id}/#{word}") }
node.update_column(:score, 0)
Push.create(self, :kind => :rewritten, :username => moderator.name)
end

Expand Down

0 comments on commit ba0fc41

Please sign in to comment.