Module: MakeVoteable::Voteable

Extended by:
ActiveSupport::Concern
Defined in:
lib/make_voteable/voteable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#votesObject

Return the difference of down and up votes. May be negative if there are more down than up votes.



17
18
19
# File 'lib/make_voteable/voteable.rb', line 17

def votes
  self.up_votes - self.down_votes
end