Module: Recommendations::Item::Ratings

Included in:
Recommendations::Item
Defined in:
lib/recommendations/item/ratings.rb

Instance Method Summary collapse

Instance Method Details

#ratings(rating, tolerance = Recommendations.configuration.user_tolerance) ⇒ Object



4
5
6
# File 'lib/recommendations/item/ratings.rb', line 4

def ratings(rating, tolerance = Recommendations.configuration.user_tolerance)
  Recommendations.redis.zrevrangebyscore("recommendations:ratings:item:#{id}", Float(rating) + tolerance, Float(rating) - tolerance)
end