From 9d42bff285551303ed4f49935991321de570564e Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 22 Dec 2016 23:07:46 +0100 Subject: Hide follow/unfollow button from public page if follow already requested --- app/models/account.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models') 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 -- cgit