chore: Sort notifications based on last_activity_at.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user