about summary refs log tree commit diff
path: root/app/models/concerns/account_interactions.rb
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-10-18 19:02:35 +0900
committerGitHub <noreply@github.com>2021-10-18 12:02:35 +0200
commit17f4e457b3a909522a230fd1f1f8f737e3faad87 (patch)
treea43668d4509e3e0ba9d0b0e17ea548a3901eb07e /app/models/concerns/account_interactions.rb
parent766a361b86f8c8212c08d3bae1d4728c3c5b1f09 (diff)
Add remove from followers api (#16864)
* Add followed_by? to account_interactions

* Add RemoveFromFollowersService

* Fix AccountBatch to use RemoveFromFollowersService

* Add remove from followers API
Diffstat (limited to 'app/models/concerns/account_interactions.rb')
-rw-r--r--app/models/concerns/account_interactions.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb
index 8f19176a7..ad1665dc4 100644
--- a/app/models/concerns/account_interactions.rb
+++ b/app/models/concerns/account_interactions.rb
@@ -195,6 +195,10 @@ module AccountInteractions
     !following_anyone?
   end
 
+  def followed_by?(other_account)
+    other_account.following?(self)
+  end
+
   def blocking?(other_account)
     block_relationships.where(target_account: other_account).exists?
   end