Module: VotableLAdames

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

Instance Method Summary collapse

Instance Method Details

#down_votesObject



17
18
19
# File 'lib/voteable_l_adames.rb', line 17

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

#total_votesObject



9
10
11
# File 'lib/voteable_l_adames.rb', line 9

def total_votes
  self.up_votes - self.down_votes
end

#up_votesObject



13
14
15
# File 'lib/voteable_l_adames.rb', line 13

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