Skip to content
Snippets Groups Projects
Unverified Commit aff6a150 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

When follow is removed, remove endorsement (#8149)

parent 0dcc1950
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,15 @@ class Follow < ApplicationRecord
end
before_validation :set_uri, only: :create
after_destroy :remove_endorsements
private
def set_uri
self.uri = ActivityPub::TagManager.instance.generate_uri_for(self) if uri.nil?
end
def remove_endorsements
AccountPin.where(target_account_id: target_account_id, account_id: account_id).delete_all
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment