only count downvotes in downvote summary

This commit is contained in:
joshua stein 2012-10-09 09:45:24 -05:00
parent 468a0cbe60
commit 24ed0e1f6f

View file

@ -83,7 +83,7 @@ class Comment < ActiveRecord::Base
def downvote_summary
reasons = {}
Vote.where(:comment_id => self.id).each do |v|
Vote.where(:comment_id => self.id, :vote => -1).each do |v|
reasons[v.reason] ||= 0
reasons[v.reason] += 1
end