module Voteable

Public Instance Methods

down_votes() click to toggle source
# File lib/ckb-voteable.rb, line 16
def down_votes
  votes.where(value: false).size
end
total_votes() click to toggle source
# File lib/ckb-voteable.rb, line 8
def total_votes
  up_votes - down_votes
end
up_votes() click to toggle source
# File lib/ckb-voteable.rb, line 12
def up_votes
  votes.where(value: true).size
end