Module: VotableLAdames
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/voteable_l_adames.rb
Instance Method Summary collapse
Instance Method Details
#down_votes ⇒ Object
17 18 19 |
# File 'lib/voteable_l_adames.rb', line 17 def down_votes self.votes.where(vote: false).size end |
#total_votes ⇒ Object
9 10 11 |
# File 'lib/voteable_l_adames.rb', line 9 def total_votes self.up_votes - self.down_votes end |
#up_votes ⇒ Object
13 14 15 |
# File 'lib/voteable_l_adames.rb', line 13 def up_votes self.votes.where(vote: true).size end |