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