Make notification ordering deterministic.

This commit is contained in:
Alp Keser
2026-02-12 15:32:10 +03:00
parent b755522a73
commit abcbb74ac8
+1 -1
View File
@@ -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