Sha256: 93ea0c5735b013f58527ef57d19565e896b14a2ed2a7a4b75f8cf0fe28065a3f

Contents?: true

Size: 329 Bytes

Versions: 1

Compression:

Stored size: 329 Bytes

Contents

module MakeVoteable
  module Voteable
    extend ActiveSupport::Concern

    module ClassMethods
      def voteable?
        true
      end
    end

    # Return the difference of down and up votes.
    # May be negative if there are more down than up votes.
    def votes
      self.up_votes - self.down_votes
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
make_voteable-0.0.2 lib/make_voteable/voteable.rb