module VoteGem
Constants
- VERSION
Public Instance Methods
down_votes()
click to toggle source
# File lib/vote_gem.rb, line 9 def down_votes self.votes.where(vote: false).length end
total_votes()
click to toggle source
# File lib/vote_gem.rb, line 13 def total_votes up_votes - down_votes end
up_votes()
click to toggle source
Your code goes hereā¦
# File lib/vote_gem.rb, line 5 def up_votes self.votes.where(vote: true).length end