mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Reload only notifications when refreshing notification count (#8221)
Previously, we used to reload the whole User instance which discarded any changes made (for example setting 'unstage' to false).
This commit is contained in:
@@ -218,7 +218,8 @@ class Notification < ActiveRecord::Base
|
||||
|
||||
def refresh_notification_count
|
||||
begin
|
||||
user.reload.publish_notifications_state
|
||||
user.notifications.reset
|
||||
user.publish_notifications_state
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
# happens when we delete a user
|
||||
end
|
||||
|
Reference in New Issue
Block a user