module SuperVotes

Constants

VERSION

Public Instance Methods

down_votes() click to toggle source
# File lib/super_votes.rb, line 8
def down_votes
  self.votes.where(vote: false).length
end
total_votes() click to toggle source
# File lib/super_votes.rb, line 12
def total_votes
  up_votes - down_votes
end
up_votes() click to toggle source
# File lib/super_votes.rb, line 4
def up_votes
  self.votes.where(vote: true).length
end