diff options
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 9bb2b3746..236f95c1f 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -215,6 +215,17 @@ 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, + content_type: content_type, + created_at: at_time || edited_at + ) + end + def edited? edited_at.present? end |