Add votes_count

This commit is contained in:
Riyad Preukschas 2012-09-08 02:37:29 +02:00
parent 2e0d5c2250
commit 7b0c7ae52c
2 changed files with 34 additions and 0 deletions

View file

@ -8,4 +8,9 @@ module Votes
def downvotes
notes.select(&:downvote?).size
end
# Return the total number of votes
def votes_count
upvotes + downvotes
end
end