From a08e724476f47b85de9bb334eeadaf882a7a23ee Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 25 Mar 2016 02:13:30 +0100 Subject: Fix subscriptions:clear task, refactor feeds, refactor streamable activites and atom feed generation to some extent, as well as the way mentions are stored --- app/models/follow.rb | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'app/models/follow.rb') diff --git a/app/models/follow.rb b/app/models/follow.rb index e458a07f3..94263b1a7 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -1,9 +1,9 @@ class Follow < ActiveRecord::Base + include Streamable + belongs_to :account belongs_to :target_account, class_name: 'Account' - has_one :stream_entry, as: :activity - validates :account, :target_account, presence: true validates :account_id, uniqueness: { scope: :target_account_id } @@ -16,22 +16,10 @@ class Follow < ActiveRecord::Base end def object_type - target.object_type - end - - def content - self.destroyed? ? "#{self.account.acct} is no longer following #{self.target_account.acct}" : "#{self.account.acct} started following #{self.target_account.acct}" + :person end def title - content - end - - def mentions - [] - end - - after_create do - self.account.stream_entries.create!(activity: self) + self.destroyed? ? "#{self.account.acct} is no longer following #{self.target_account.acct}" : "#{self.account.acct} started following #{self.target_account.acct}" end end -- cgit