module VoteableYhagio
Public Instance Methods
down_votes()
click to toggle source
# File lib/voteable_yhagio.rb, line 16 def down_votes self.votes.where(vote: false).size end
total_votes()
click to toggle source
# File lib/voteable_yhagio.rb, line 8 def total_votes self.up_votes - self.down_votes end
up_votes()
click to toggle source
# File lib/voteable_yhagio.rb, line 12 def up_votes self.votes.where(vote: true).size end