about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-12-15 18:50:11 +0100
committerGitHub <noreply@github.com>2022-12-15 18:50:11 +0100
commit70415714f14e067aba518a105c96475db31fa124 (patch)
tree6a5e3bb7bec28809235025af12994b70c1082f5f /app/models
parent7a3c6bb88833a48253eb4795f4ee1127c6b5b5b0 (diff)
Add follow request banner on account header (#20785)
* Add requested_by to relationship maps

* Display whether an account has requested to follow you on their profile
Diffstat (limited to 'app/models')
-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 15c49f2fe..de8bf338f 100644
--- a/app/models/concerns/account_interactions.rb
+++ b/app/models/concerns/account_interactions.rb
@@ -44,6 +44,10 @@ module AccountInteractions
       end
     end
 
+    def requested_by_map(target_account_ids, account_id)
+      follow_mapping(FollowRequest.where(account_id: target_account_ids, target_account_id: account_id), :account_id)
+    end
+
     def endorsed_map(target_account_ids, account_id)
       follow_mapping(AccountPin.where(account_id: account_id, target_account_id: target_account_ids), :target_account_id)
     end