From abcbb74ac8253069e9ec9d31e8e7a03e6852c13f Mon Sep 17 00:00:00 2001 From: Alp Keser Date: Thu, 12 Feb 2026 15:32:10 +0300 Subject: [PATCH] Make notification ordering deterministic. --- app/models/notification.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index 3d7df5885..70b02de2b 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -9,7 +9,7 @@ class Notification < ApplicationRecord scope :unread, -> { where(read_at: nil) } scope :read, -> { where.not(read_at: nil) } - scope :ordered, -> { order(read_at: :desc, updated_at: :desc) } + scope :ordered, -> { order(read_at: :desc, updated_at: :desc, id: :desc) } scope :preloaded, -> { preload(:card, :creator, :account, source: [ :board, :creator, { eventable: [ :closure, :board, :assignments ] } ]) } before_validation :set_card