]> cat aescling's git repositories - mastodon.git/commitdiff
Use update method to update session in WebPushNotificationWorker (#4235)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Mon, 17 Jul 2017 09:03:42 +0000 (18:03 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 17 Jul 2017 09:03:42 +0000 (11:03 +0200)
app/workers/web_push_notification_worker.rb

index 0568a3e028cba05356f5bf50a7979830f5e6f85f..f14efc99e1cf388849c4c995e91954f92633e27b 100644 (file)
@@ -17,8 +17,7 @@ class WebPushNotificationWorker
       rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription
         # Subscription expiration is not currently implemented in any browser
         session.web_push_subscription.destroy!
-        session.web_push_subscription = nil
-        session.save!
+        session.update!(web_push_subscription: nil)
       rescue Webpush::PayloadTooLarge => e
         Rails.logger.error(e)
       end