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