Sha256: 8fae56d735c31b6f2cd9ec42139c2b4ec8f777e5f4c9eacbf1cd32f07d744c42
Contents?: true
Size: 904 Bytes
Versions: 16
Compression:
Stored size: 904 Bytes
Contents
module Recommendable module Ratable module Dislikable # Fetch a list of users that have disliked this item. # # @return [Array] a list of users that have disliked this item def disliked_by Recommendable.query(Recommendable.config.user_class, disliked_by_ids) end # Get the number of users that have disliked this item # # @return [Fixnum] the number of users that have disliked this item def disliked_by_count Recommendable.redis.scard(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end # Get the IDs of users that have disliked this item. # # @return [Array] the IDs of users that have disliked this item def disliked_by_ids Recommendable.redis.smembers(Recommendable::Helpers::RedisKeyMapper.disliked_by_set_for(self.class, id)) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems