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:
parent
94d2182717
commit
0518492158
22 changed files with 304 additions and 266 deletions
|
@ -6,17 +6,13 @@ class StreamEntry < ApplicationRecord
|
|||
belongs_to :account, inverse_of: :stream_entries
|
||||
belongs_to :activity, polymorphic: true
|
||||
|
||||
belongs_to :status, foreign_type: 'Status', foreign_key: 'activity_id'
|
||||
belongs_to :follow, foreign_type: 'Follow', foreign_key: 'activity_id'
|
||||
belongs_to :favourite, foreign_type: 'Favourite', foreign_key: 'activity_id'
|
||||
belongs_to :block, foreign_type: 'Block', foreign_key: 'activity_id'
|
||||
belongs_to :follow_request, foreign_type: 'FollowRequest', foreign_key: 'activity_id'
|
||||
belongs_to :status, foreign_type: 'Status', foreign_key: 'activity_id', inverse_of: :stream_entry
|
||||
|
||||
validates :account, :activity, presence: true
|
||||
|
||||
STATUS_INCLUDES = [:account, :stream_entry, :media_attachments, :tags, mentions: :account, reblog: [:stream_entry, :account, mentions: :account], thread: [:stream_entry, :account]].freeze
|
||||
|
||||
scope :with_includes, -> { includes(:account, status: STATUS_INCLUDES, favourite: [:account, :stream_entry, status: STATUS_INCLUDES], follow: [:target_account, :stream_entry]) }
|
||||
scope :with_includes, -> { includes(:account, status: STATUS_INCLUDES) }
|
||||
|
||||
def object_type
|
||||
if orphaned?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue