chore: Sort notifications based on last_activity_at.

This commit is contained in:
Muhsin Keloth
2023-12-20 13:21:33 +05:30
parent 7b32bd7c14
commit 7605d6c855
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -60,6 +60,6 @@ class NotificationFinder
end
def notifications
@notifications.page(current_page).per(RESULTS_PER_PAGE).order(updated_at: :desc)
@notifications.page(current_page).per(RESULTS_PER_PAGE).order(last_activity_at: :asc)
end
end
+1 -1
View File
@@ -49,7 +49,7 @@ class Notification < ApplicationRecord
# TODO: Get rid of default scope
# https://stackoverflow.com/a/1834250/939299
default_scope { order(id: :desc) }
default_scope { order(last_activity_at: :desc) }
PRIMARY_ACTORS = ['Conversation'].freeze