Order notifications by updated_at instead of created_at

closes #7568
This commit is contained in:
Steffen van Bergerem 2017-08-22 16:27:08 +02:00 committed by Benjamin Neff
parent 5ea7b8ee13
commit c91c19b633
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
2 changed files with 2 additions and 1 deletions

View file

@ -3,6 +3,7 @@
## Refactor ## Refactor
* Remove title from profile photo upload button [#7551](https://github.com/diaspora/diaspora/pull/7551) * Remove title from profile photo upload button [#7551](https://github.com/diaspora/diaspora/pull/7551)
* Remove Internet Explorer workarounds [#7557](https://github.com/diaspora/diaspora/pull/7557) * Remove Internet Explorer workarounds [#7557](https://github.com/diaspora/diaspora/pull/7557)
* Sort notifications by last interaction [#7568](https://github.com/diaspora/diaspora/pull/7568)
## Bug fixes ## Bug fixes
* Fix displaying polls with long answers [#7579](https://github.com/diaspora/diaspora/pull/7579) * Fix displaying polls with long answers [#7579](https://github.com/diaspora/diaspora/pull/7579)

View file

@ -32,7 +32,7 @@ class NotificationsController < ApplicationController
@notifications = WillPaginate::Collection.create(page, per_page, Notification.where(conditions).count ) do |pager| @notifications = WillPaginate::Collection.create(page, per_page, Notification.where(conditions).count ) do |pager|
result = Notification.where(conditions) result = Notification.where(conditions)
.includes(:target, :actors => :profile) .includes(:target, :actors => :profile)
.order('created_at desc') .order("updated_at desc")
.limit(pager.per_page) .limit(pager.per_page)
.offset(pager.offset) .offset(pager.offset)