Module: Voteable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/voteable.rb
Instance Method Summary collapse
Instance Method Details
#count_down_votes ⇒ Object
16 17 18 |
# File 'lib/voteable.rb', line 16 def count_down_votes votes.where(vote: false).size end |
#count_up_votes ⇒ Object
12 13 14 |
# File 'lib/voteable.rb', line 12 def count_up_votes votes.where(vote: true).size end |
#total_votes ⇒ Object
8 9 10 |
# File 'lib/voteable.rb', line 8 def total_votes count_up_votes - count_down_votes end |