Module: VoteableAms
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/voteable_ams.rb
Instance Method Summary collapse
Instance Method Details
#downvotes ⇒ Object
16 17 18 |
# File 'lib/voteable_ams.rb', line 16 def downvotes votes.reject(&:upvote).size end |
#upvotes ⇒ Object
12 13 14 |
# File 'lib/voteable_ams.rb', line 12 def upvotes votes.select(&:upvote).size end |
#vote_count ⇒ Object
8 9 10 |
# File 'lib/voteable_ams.rb', line 8 def vote_count upvotes - downvotes end |