Browse Source

When follow is removed, remove endorsement (#8149)

master
Eugen Rochko 6 years ago
committed by GitHub
parent
commit
aff6a15061
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      app/models/follow.rb

+ 5
- 0
app/models/follow.rb View File

@ -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

Loading…
Cancel
Save