logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: f9d7ec89711e29a7c1fdf060abf9599b65c9f515
parent: 40fd1de4889584900eeea26514c251ca62fa95f5
Author: alpaca-tc <alpaca-tc@alpaca.tc>
Date:   Sat, 15 Apr 2017 20:16:24 +0900

ActiveRecord::Relation does not respond to `#id` (#1834)


Diffstat:

Mapp/services/pubsubhubbub/unsubscribe_service.rb2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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')