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