Module: Voteable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/voteable_tae.rb
Overview
using concerns
Instance Method Summary collapse
Instance Method Details
#down_votes ⇒ Object
18 19 20 |
# File 'lib/voteable_tae.rb', line 18 def down_votes self.votes.where(vote: false).size end |
#total_votes ⇒ Object
10 11 12 |
# File 'lib/voteable_tae.rb', line 10 def total_votes self.up_votes - self.down_votes end |
#up_votes ⇒ Object
14 15 16 |
# File 'lib/voteable_tae.rb', line 14 def up_votes self.votes.where(vote: true).size end |