Add editing for published statuses (#17320)
* Add editing for published statuses * Fix change of multiple-choice boolean in poll not resetting votes * Remove the ability to update existing media attachments for now
This commit is contained in:
parent
20a3564ab2
commit
63002cde03
25 changed files with 839 additions and 77 deletions
|
@ -208,6 +208,10 @@ class MediaAttachment < ApplicationRecord
|
|||
file.blank? && remote_url.present?
|
||||
end
|
||||
|
||||
def significantly_changed?
|
||||
description_previously_changed? || thumbnail_updated_at_previously_changed? || file_meta_previously_changed?
|
||||
end
|
||||
|
||||
def larger_media_format?
|
||||
video? || gifv? || audio?
|
||||
end
|
||||
|
|
|
@ -209,6 +209,16 @@ class Status < ApplicationRecord
|
|||
public_visibility? || unlisted_visibility?
|
||||
end
|
||||
|
||||
def snapshot!(media_attachments_changed: false, account_id: nil, at_time: nil)
|
||||
edits.create!(
|
||||
text: text,
|
||||
spoiler_text: spoiler_text,
|
||||
media_attachments_changed: media_attachments_changed,
|
||||
account_id: account_id || self.account_id,
|
||||
created_at: at_time || edited_at
|
||||
)
|
||||
end
|
||||
|
||||
def edited?
|
||||
edited_at.present?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue