about summary refs log tree commit diff
diff options
context:
space:
mode:
authoralpaca-tc <alpaca-tc@alpaca.tc>2017-04-15 20:16:24 +0900
committerEugen <eugen@zeonfederated.com>2017-04-15 13:16:24 +0200
commitf9d7ec89711e29a7c1fdf060abf9599b65c9f515 (patch)
treef5a93d2a5bf474eb5d91d2cc0aff9ecf0fd61ed2
parent40fd1de4889584900eeea26514c251ca62fa95f5 (diff)
ActiveRecord::Relation does not respond to `#id` (#1834)
-rw-r--r--app/services/pubsubhubbub/unsubscribe_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/pubsubhubbub/unsubscribe_service.rb b/app/services/pubsubhubbub/unsubscribe_service.rb
index 62459a0aa..7adadf8ed 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')