changed comments helper to proper return unread comments available for current_user

This commit is contained in:
raluka 2015-09-03 14:20:11 +02:00
parent f3fa68e371
commit 55eddbfde7

View file

@ -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