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