diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 54d79425..3498aaa2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -280,6 +280,7 @@ module ApplicationHelper end def unread_notifications(user) - Comment.find_since_last_login(user) + available_conferences_ids = Conference.with_roles([:admin, :organizer, :cfp], user).pluck(:id) + Comment.find_since_last_login(user).where(commentable_type: 'Event', commentable_id: Event.where(conference_id: available_conferences_ids)) end end