gitlabhq/app/roles/votes.rb
Riyad Preukschas 2e0d5c2250 Add downvotes
2012-09-08 16:05:48 +02:00

12 lines
224 B
Ruby

module Votes
# Return the number of +1 comments (upvotes)
def upvotes
notes.select(&:upvote?).size
end
# Return the number of -1 comments (downvotes)
def downvotes
notes.select(&:downvote?).size
end
end