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