Module: Recommendable::Ratable::Dislikable
- Defined in:
- lib/recommendable/ratable/dislikable.rb
Instance Method Summary collapse
-
#disliked_by ⇒ Array
Fetch a list of users that have disliked this item.
-
#disliked_by_count ⇒ Fixnum
Get the number of users that have disliked this item.
-
#disliked_by_ids ⇒ Array
Get the IDs of users that have disliked this item.
Instance Method Details
#disliked_by ⇒ Array
Fetch a list of users that have disliked this item.
7 8 9 |
# File 'lib/recommendable/ratable/dislikable.rb', line 7 def disliked_by Recommendable.query(Recommendable.config.user_class, disliked_by_ids) end |
#disliked_by_count ⇒ Fixnum
Get the number of users that have disliked this item
14 15 16 |
# File 'lib/recommendable/ratable/dislikable.rb', line 14 def disliked_by_count Recommendable.redis.scard(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end |
#disliked_by_ids ⇒ Array
Get the IDs of users that have disliked this item.
21 22 23 |
# File 'lib/recommendable/ratable/dislikable.rb', line 21 def disliked_by_ids Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end |