0
0
Fork 0

Stop trying to shoehorn all Salmon updates into the poor database-connected

StreamEntry model. Simply render Salmon slaps as they are needed
This commit is contained in:
Eugen Rochko 2017-02-12 00:48:53 +01:00
parent 94d2182717
commit 0518492158
22 changed files with 304 additions and 266 deletions

View file

@ -2,7 +2,6 @@
class Follow < ApplicationRecord
include Paginable
include Streamable
belongs_to :account
belongs_to :target_account, class_name: 'Account'
@ -11,16 +10,4 @@ class Follow < ApplicationRecord
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 title
destroyed? ? "#{account.acct} is no longer following #{target_account.acct}" : "#{account.acct} started following #{target_account.acct}"
end
end