diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-25 02:13:30 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-03-25 02:13:30 +0100 |
commit | a08e724476f47b85de9bb334eeadaf882a7a23ee (patch) | |
tree | d779668fa289d2b7077c878b19fc6691a57142b7 /app/models/follow.rb | |
parent | 9594f0e858172b9295c5598fcb6ab10506d3046d (diff) |
Fix subscriptions:clear task, refactor feeds, refactor streamable activites
and atom feed generation to some extent, as well as the way mentions are stored
Diffstat (limited to 'app/models/follow.rb')
-rw-r--r-- | app/models/follow.rb | 20 |
1 files changed, 4 insertions, 16 deletions
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 |