Module: JulienVotable::InstanceMethods
- Defined in:
- lib/julien_votable.rb
Instance Method Summary collapse
Instance Method Details
#down_votes ⇒ Object
19 20 21 |
# File 'lib/julien_votable.rb', line 19 def down_votes self.votes.where(vote: false).count end |
#total_votes ⇒ Object
11 12 13 |
# File 'lib/julien_votable.rb', line 11 def total_votes self.up_votes - self.down_votes end |
#up_votes ⇒ Object
15 16 17 |
# File 'lib/julien_votable.rb', line 15 def up_votes self.votes.where(vote: true).count end |