Module: Voteable::InstanceMethods
- Defined in:
- lib/voteable-cdub.rb
Instance Method Summary collapse
Instance Method Details
#total_votes ⇒ Object
11 12 13 |
# File 'lib/voteable-cdub.rb', line 11 def total_votes self.votes.where(vote: true).size - self.votes.where(vote: false).size end |
#up_votes ⇒ Object
15 16 17 |
# File 'lib/voteable-cdub.rb', line 15 def up_votes self.votes.where(vote: true).size end |