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 Favourite < ApplicationRecord
include Paginable
include Streamable
belongs_to :account, inverse_of: :favourites
belongs_to :status, inverse_of: :favourites
@ -11,26 +10,6 @@ class Favourite < ApplicationRecord
validates :status_id, uniqueness: { scope: :account_id }
def verb
destroyed? ? :unfavorite : :favorite
end
def title
destroyed? ? "#{account.acct} no longer favourites a status by #{status.account.acct}" : "#{account.acct} favourited a status by #{status.account.acct}"
end
def thread
status
end
def target
thread
end
def hidden?
status.private_visibility?
end
before_validation do
self.status = status.reblog if status.reblog?
end