about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-12-22 23:07:46 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-12-22 23:07:46 +0100
commit9d42bff285551303ed4f49935991321de570564e (patch)
treed41d41fe351e5bf523f93bbb29c091caddb0f3cd /app/models
parentb891a81008d2cf595cb37432a8e1f36606db16d6 (diff)
Hide follow/unfollow button from public page if follow already requested
Diffstat (limited to 'app/models')
-rw-r--r--app/models/account.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index 273c09833..5c1f6e7c1 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -91,6 +91,10 @@ class Account < ApplicationRecord
     blocking.include?(other_account)
   end
 
+  def requested?(other_account)
+    follow_requests.where(target_account: other_account).exists?
+  end
+
   def local?
     domain.nil?
   end