diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index fdc89b961a2e33c7e8ad42646872daad28ae4b88..2174c8f2d2f1d1e3994ae203def62b93f6266b5b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -26,7 +26,7 @@ class ApplicationController < ActionController::Base if user_signed_in? @aspect = nil @object_aspect_ids = [] - @all_aspects = current_user.aspects.includes(:aspect_memberships) + @all_aspects = current_user.aspects.includes(:aspect_memberships, :post_visibilities) @notification_count = Notification.for(current_user, :unread =>true).count @user_id = current_user.id end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 33f5fc07a064773faed03459e8574520bf724d7f..81e013ebfae1c55289cfef024c4be02d8d4b409f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -22,13 +22,13 @@ module ApplicationHelper def aspects_with_post aspects, post aspects.select do |aspect| - aspect.post_ids.include?(post.id) + aspect.post_visibilities.detect{|pv| pv.post_id == post.id} end end def aspects_without_post aspects, post aspects.reject do |aspect| - aspect.post_ids.include?(post.id) + aspect.post_visibilities.detect{|pv| pv.post_id == post.id} end end