diff options
Diffstat (limited to 'app/roles/votes.rb')
-rw-r--r-- | app/roles/votes.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/app/roles/votes.rb b/app/roles/votes.rb deleted file mode 100644 index 10fa120c6e9..00000000000 --- a/app/roles/votes.rb +++ /dev/null @@ -1,33 +0,0 @@ -module Votes - - # Return the number of -1 comments (downvotes) - def downvotes - notes.select(&:downvote?).size - end - - def downvotes_in_percent - if votes_count.zero? - 0 - else - 100.0 - upvotes_in_percent - end - end - - # Return the number of +1 comments (upvotes) - def upvotes - notes.select(&:upvote?).size - end - - def upvotes_in_percent - if votes_count.zero? - 0 - else - 100.0 / votes_count * upvotes - end - end - - # Return the total number of votes - def votes_count - upvotes + downvotes - end -end |