958deab2c7
The problem was related to tying the invalidation to the association of unread notifications. Its cache key can remain constant as you read old notifications. https://app.box-car.com/5986089/cards/2620/edit
10 lines
358 B
Ruby
10 lines
358 B
Ruby
class Notifications::TraysController < ApplicationController
|
|
def show
|
|
@notifications = Current.user.notifications.unread.ordered.limit(100)
|
|
|
|
# Invalidate on the whole set instead of the unread set since the max updated at in the unread set
|
|
# can stay the same when reading old notifications.
|
|
fresh_when Current.user.notifications
|
|
end
|
|
end
|