0
0
Fork 0

Add cold-start follow recommendations (#15945)

This commit is contained in:
Eugen Rochko 2021-04-12 12:37:14 +02:00 committed by GitHub
parent ad61265268
commit f7117646af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 560 additions and 26 deletions

View file

@ -21,6 +21,10 @@ class Form::AccountBatch
approve!
when 'reject'
reject!
when 'suppress_follow_recommendation'
suppress_follow_recommendation!
when 'unsuppress_follow_recommendation'
unsuppress_follow_recommendation!
end
end
@ -79,4 +83,18 @@ class Form::AccountBatch
records.each { |account| authorize(account.user, :reject?) }
.each { |account| DeleteAccountService.new.call(account, reserve_email: false, reserve_username: false) }
end
def suppress_follow_recommendation!
authorize(:follow_recommendation, :suppress?)
accounts.each do |account|
FollowRecommendationSuppression.create(account: account)
end
end
def unsuppress_follow_recommendation!
authorize(:follow_recommendation, :unsuppress?)
FollowRecommendationSuppression.where(account_id: account_ids).destroy_all
end
end