Skip to content

Commit

Permalink
Fix query for unseen news popups
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Sep 13, 2023
1 parent 69f4159 commit d510971
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/controllers/news_popups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d510971

Please sign in to comment.