Add votes_count
This commit is contained in:
parent
2e0d5c2250
commit
7b0c7ae52c
2 changed files with 34 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue