about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 47671c0f5..4fabf24ef 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -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