diff --git a/app/controllers/page_collections_controller.rb b/app/controllers/page_collections_controller.rb index 8b9b62e3..83c2036d 100644 --- a/app/controllers/page_collections_controller.rb +++ b/app/controllers/page_collections_controller.rb @@ -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