diff options
Diffstat (limited to 'app/models/follow.rb')
-rw-r--r-- | app/models/follow.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/app/models/follow.rb b/app/models/follow.rb index f83490caa..8bfe8b2f6 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -2,29 +2,12 @@ class Follow < ApplicationRecord include Paginable - include Streamable - belongs_to :account - belongs_to :target_account, class_name: 'Account' + belongs_to :account, counter_cache: :following_count + belongs_to :target_account, class_name: 'Account', counter_cache: :followers_count has_one :notification, as: :activity, dependent: :destroy validates :account, :target_account, presence: true validates :account_id, uniqueness: { scope: :target_account_id } - - def verb - destroyed? ? :unfollow : :follow - end - - def target - target_account - end - - def object_type - :person - end - - def title - destroyed? ? "#{account.acct} is no longer following #{target_account.acct}" : "#{account.acct} started following #{target_account.acct}" - end end |