Module: RedisVoteable::ClassMethods
- Defined in:
- lib/redis_voteable.rb
Instance Method Summary collapse
-
#acts_as_voteable ⇒ Object
Specify a model as voteable.
-
#acts_as_voter ⇒ Object
Specify a model as voter.
- #voteable? ⇒ Boolean
- #voter? ⇒ Boolean
Instance Method Details
#acts_as_voteable ⇒ Object
Specify a model as voteable.
Example: class Question < ActiveRecord::Base
acts_as_voteable
end
54 55 56 57 |
# File 'lib/redis_voteable.rb', line 54 def acts_as_voteable RedisVoteable.redis ||= Redis.new(RedisVoteable.redis_voteable_settings) include Voteable end |
#acts_as_voter ⇒ Object
Specify a model as voter.
Example: class User < ActiveRecord::Base
acts_as_voter
end
65 66 67 68 |
# File 'lib/redis_voteable.rb', line 65 def acts_as_voter RedisVoteable.redis ||= Redis.new(RedisVoteable.redis_voteable_settings) include Voter end |
#voteable? ⇒ Boolean
40 41 42 |
# File 'lib/redis_voteable.rb', line 40 def voteable? false end |
#voter? ⇒ Boolean
44 45 46 |
# File 'lib/redis_voteable.rb', line 44 def voter? false end |