README.md in disco-0.2.7 vs README.md in disco-0.2.8
- old
+ new
@@ -42,10 +42,12 @@
{user_id: 1, item_id: 1},
{user_id: 2, item_id: 1}
])
```
+> Each `user_id`/`item_id` combination should only appear once
+
Get user-based recommendations - “users like you also liked”
```ruby
recommender.user_recs(user_id)
```
@@ -95,14 +97,10 @@
### Ahoy
[Ahoy](https://github.com/ankane/ahoy) is a great source for implicit feedback
```ruby
-views = Ahoy::Event.
- where(name: "Viewed post").
- group(:user_id).
- group("properties->>'post_id'"). # postgres syntax
- count
+views = Ahoy::Event.where(name: "Viewed post").group(:user_id).group_prop(:post_id).count
data =
views.map do |(user_id, post_id), _|
{
user_id: user_id,