From f9d7ec89711e29a7c1fdf060abf9599b65c9f515 Mon Sep 17 00:00:00 2001 From: alpaca-tc Date: Sat, 15 Apr 2017 20:16:24 +0900 Subject: [PATCH] ActiveRecord::Relation does not respond to `#id` (#1834) --- app/services/pubsubhubbub/unsubscribe_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/pubsubhubbub/unsubscribe_service.rb b/app/services/pubsubhubbub/unsubscribe_service.rb index 62459a0aa5e..7adadf8ed28 100644 --- a/app/services/pubsubhubbub/unsubscribe_service.rb +++ b/app/services/pubsubhubbub/unsubscribe_service.rb @@ -4,7 +4,7 @@ class Pubsubhubbub::UnsubscribeService < BaseService def call(account, callback) return ['Invalid topic URL', 422] if account.nil? - subscription = Subscription.where(account: account, callback_url: callback) + subscription = Subscription.find_by(account: account, callback_url: callback) unless subscription.nil? Pubsubhubbub::ConfirmationWorker.perform_async(subscription.id, 'unsubscribe')