More natural to fetch that which will be shown first

This commit is contained in:
David Heinemeier Hansson
2025-04-16 16:58:03 +02:00
parent 5ce289642f
commit d8ec2c3364
+3 -3
View File
@@ -1,11 +1,11 @@
class NotificationsController < ApplicationController
def index
set_page_and_extract_portion_from Current.user.notifications.read.ordered
if @page.first?
unless current_page_param
@unread = Current.user.notifications.unread.ordered
end
set_page_and_extract_portion_from Current.user.notifications.read.ordered
respond_to do |format|
format.turbo_stream if current_page_param # Allows read-all action to side step pagination
format.html