mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
lil smarter collection discovery
This commit is contained in:
parent
6143bebc77
commit
c2406dfd6a
@ -11,10 +11,11 @@ class PageCollectionsController < ApplicationController
|
||||
|
||||
followed_user_ids = UserFollowing.where(user_id: current_user.id).pluck(:followed_user_id)
|
||||
@network_collections = PageCollection.where(user_id: followed_user_ids, privacy: 'public')
|
||||
|
||||
@random_collections = PageCollection.where(privacy: 'public').sample(9)
|
||||
|
||||
@followed_collections = current_user.followed_page_collections
|
||||
|
||||
@random_collections = PageCollection.where(privacy: 'public').where.not(
|
||||
id: @my_collections.pluck(:id) + @network_collections.pluck(:id) + @followed_collections.pluck(:id)
|
||||
).sample(9)
|
||||
end
|
||||
|
||||
# GET /page_collections/1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user