tweaks to similar posts

This commit is contained in:
Albert Yi
2018-07-20 15:05:51 -07:00
parent 6fb20fca89
commit df6e86551a
5 changed files with 32 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ module PostSets
def posts
@posts ||= begin
response = RecommenderService.similar(@post)
post_ids = response.reject {|x| x[0] == @post.id}.slice(0, 5).map {|x| x[0]}
post_ids = response.reject {|x| x[0] == @post.id}.slice(0, 6).map {|x| x[0]}
::Post.find(post_ids)
end
end