Hide follow/unfollow button from public page if follow already requested

This commit is contained in:
Eugen Rochko 2016-12-22 23:07:46 +01:00
parent b891a81008
commit 9d42bff285
2 changed files with 5 additions and 1 deletions

View file

@ -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