module Voteable

Public Instance Methods

vote_down() click to toggle source
# File lib/voteable_shawn.rb, line 16
def vote_down
  self.votes.where(vote: false).size
end
vote_total() click to toggle source
# File lib/voteable_shawn.rb, line 10
def vote_total
  self.vote_up - self.vote_down
end
vote_up() click to toggle source
# File lib/voteable_shawn.rb, line 13
def vote_up
  self.votes.where(vote: true).size
end