mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
dedupe collections in network
This commit is contained in:
parent
6e4f60f8d8
commit
da621f792d
@ -15,8 +15,10 @@ class PageCollectionsController < ApplicationController
|
||||
@collections_with_pending = PageCollection.where(id: pending_submissions.pluck(:page_collection_id))
|
||||
|
||||
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')
|
||||
@followed_collections = current_user.followed_page_collections
|
||||
@network_collections = PageCollection.where(user_id: followed_user_ids, privacy: 'public').where.not(
|
||||
id: @followed_collections.pluck(:id)
|
||||
)
|
||||
|
||||
@random_collections = PageCollection.where(privacy: 'public').where.not(
|
||||
id: @my_collections.pluck(:id) + @network_collections.pluck(:id) + @followed_collections.pluck(:id)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user