From 0f688b9d7317f06b22915ef4d968190f00500ae4 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 20 Oct 2017 01:56:09 +0200 Subject: [PATCH] Group notifications by updated_at The notifications need to be grouped by the same date as they are sorted, otherwise the date used for the group doesn't match all timestamps in the group and also the groups are sorted by the wrong date. This fixes #7647, a regression of #7568. closes #7648 --- Changelog.md | 2 +- app/controllers/notifications_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index d4679beb5..9ebd9e557 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,7 +10,7 @@ after you've upgraded. ## Refactor * 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) -* Sort notifications by last interaction [#7568](https://github.com/diaspora/diaspora/pull/7568) +* Sort notifications by last interaction [#7568](https://github.com/diaspora/diaspora/pull/7568) [#7648](https://github.com/diaspora/diaspora/pull/7648) * Remove tiff support from photos [#7576](https://github.com/diaspora/diaspora/pull/7576) * Remove reference from reshares when original post is deleted [#7578](https://github.com/diaspora/diaspora/pull/7578) * Merge migrations from before 0.6.0.0 to CreateSchema [#7580](https://github.com/diaspora/diaspora/pull/7580) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 62a3d44a7..736389a64 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -40,7 +40,7 @@ class NotificationsController < ApplicationController pager.replace(result) end - @group_days = @notifications.group_by{|note| note.created_at.strftime('%Y-%m-%d')} + @group_days = @notifications.group_by {|note| note.updated_at.strftime("%Y-%m-%d") } @unread_notification_count = current_user.unread_notifications.count