From a3f771752bab642a72eb5cb0f2156000a990f23d Mon Sep 17 00:00:00 2001 From: Henry Yang Date: Thu, 1 Mar 2018 22:46:22 +0000 Subject: [PATCH] @notification.app triggers loading of association :app fixes #410 --- lib/rpush/daemon/gcm/delivery.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rpush/daemon/gcm/delivery.rb b/lib/rpush/daemon/gcm/delivery.rb index 2d1531a4d..1a0e71030 100644 --- a/lib/rpush/daemon/gcm/delivery.rb +++ b/lib/rpush/daemon/gcm/delivery.rb @@ -103,7 +103,7 @@ def create_new_notification(response, unavailable_idxs) attrs = { 'app_id' => @notification.app_id, 'collapse_key' => @notification.collapse_key, 'delay_while_idle' => @notification.delay_while_idle } registration_ids = @notification.registration_ids.values_at(*unavailable_idxs) Rpush::Daemon.store.create_gcm_notification(attrs, @notification.data, - registration_ids, deliver_after_header(response), @notification.app) + registration_ids, deliver_after_header(response), @app) end def bad_request @@ -143,7 +143,7 @@ def retry_message def do_post post = Net::HTTP::Post.new(FCM_URI.path, 'Content-Type' => 'application/json', - 'Authorization' => "key=#{@notification.app.auth_key}") + 'Authorization' => "key=#{@app.auth_key}") post.body = @notification.as_json.to_json @http.request(FCM_URI, post) end