FIX: don't publish notifications_state when user has been deleted

This commit is contained in:
Régis Hanol 2018-05-26 02:27:54 +02:00
parent d23229df85
commit 338d39265a
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ class Notification < ActiveRecord::Base
protected
def refresh_notification_count
user.reload.publish_notifications_state
begin
user.reload.publish_notifications_state
rescue ActiveRecord::RecordNotFound
# happens when we delete a user
end
end
def send_email