diff --git a/app/models/notification.rb b/app/models/notification.rb index 5cd3802a4..4b69dd6e6 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -9,7 +9,6 @@ class Notification < ApplicationRecord scope :unread, -> { where(read_at: nil) } scope :read, -> { where.not(read_at: nil) } scope :ordered, -> { order(read_at: :desc, created_at: :desc) } - scope :with_unread_first, -> { order(Arel.sql("CASE WHEN read_at IS NULL THEN 0 ELSE 1 END")) } after_create_commit :broadcast_unread after_destroy_commit :broadcast_read