about summary refs log tree commit diff
path: root/app/workers/web_push_notification_worker.rb
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-07-17 18:03:48 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-07-17 11:03:48 +0200
commit7f35947d8ed26690b4505f740ee9fbc73e79009a (patch)
treefc791ed69c5e424ff425512cfea4c523bdcb5c64 /app/workers/web_push_notification_worker.rb
parent68941d4dfa91194eb6c5b9633df6d88440808e71 (diff)
Improve a query in WebPushNotificationWorker (#4234)
Diffstat (limited to 'app/workers/web_push_notification_worker.rb')
-rw-r--r--app/workers/web_push_notification_worker.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/workers/web_push_notification_worker.rb b/app/workers/web_push_notification_worker.rb
index f14efc99e..e8f1d72bd 100644
--- a/app/workers/web_push_notification_worker.rb
+++ b/app/workers/web_push_notification_worker.rb
@@ -9,7 +9,7 @@ class WebPushNotificationWorker
     recipient = Account.find(recipient_id)
     notification = Notification.find(notification_id)
 
-    sessions_with_subscriptions = recipient.user.session_activations.reject { |session| session.web_push_subscription.nil? }
+    sessions_with_subscriptions = recipient.user.session_activations.where.not(web_push_subscription: nil)
 
     sessions_with_subscriptions.each do |session|
       begin