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