Module: VinceTlVoteable

Extended by:
ActiveSupport::Concern
Defined in:
lib/vince_tl_voteable.rb

Instance Method Summary collapse

Instance Method Details

#down_votesObject



12
13
14
# File 'lib/vince_tl_voteable.rb', line 12

def down_votes
  self.votes.where(vote: false).size
end

#up_votesObject



8
9
10
# File 'lib/vince_tl_voteable.rb', line 8

def up_votes
  self.votes.where(vote: true).size
end

#vote_countObject



16
17
18
# File 'lib/vince_tl_voteable.rb', line 16

def vote_count
  up_votes - down_votes
end