diff --git a/app/controllers/news_popups_controller.rb b/app/controllers/news_popups_controller.rb index b00ffcb62..c09508fd2 100644 --- a/app/controllers/news_popups_controller.rb +++ b/app/controllers/news_popups_controller.rb @@ -8,10 +8,10 @@ def index private def unseen_news_popups - HasSeenNewsPopup - .where(user: current_user) - .left_outer_joins(:news_popup) - .select('news_popups.name', 'news_popups.active') - .where(news_popups: { active: true }) + NewsPopup + .where(active: true) + .where.not(id: HasSeenNewsPopup + .where(user: current_user) + .pluck(:news_popup_id)) end end