diff --git a/app/finders/notification_finder.rb b/app/finders/notification_finder.rb index a80078500..e4f0ff59e 100644 --- a/app/finders/notification_finder.rb +++ b/app/finders/notification_finder.rb @@ -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 diff --git a/app/models/notification.rb b/app/models/notification.rb index fdc8e287c..3cdf8d0be 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -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