about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-05-11 12:35:25 +0200
committerGitHub <noreply@github.com>2019-05-11 12:35:25 +0200
commitfe00f7a7e4469d18b43be2159fa9d953d2050f46 (patch)
treef2af743c222ad8d9dc81299195d01a3fe6b54e02 /app/models
parentd4d4e84324701243ce05930f45b2dc876e38c7d0 (diff)
parent14d855c42985503b525f1a77d00fada3bd15b96f (diff)
Merge pull request #1043 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models')
-rw-r--r--app/models/form/status_batch.rb1
-rw-r--r--app/models/tombstone.rb11
2 files changed, 7 insertions, 5 deletions
diff --git a/app/models/form/status_batch.rb b/app/models/form/status_batch.rb
index 898728067..933dfdaca 100644
--- a/app/models/form/status_batch.rb
+++ b/app/models/form/status_batch.rb
@@ -35,6 +35,7 @@ class Form::StatusBatch
   def delete_statuses
     Status.where(id: status_ids).reorder(nil).find_each do |status|
       RemovalWorker.perform_async(status.id)
+      Tombstone.find_or_create_by(uri: status.uri, account: status.account, by_moderator: true)
       log_action :destroy, status
     end
 
diff --git a/app/models/tombstone.rb b/app/models/tombstone.rb
index 997bb65fd..bf666c43a 100644
--- a/app/models/tombstone.rb
+++ b/app/models/tombstone.rb
@@ -4,11 +4,12 @@
 #
 # Table name: tombstones
 #
-#  id         :bigint(8)        not null, primary key
-#  account_id :bigint(8)
-#  uri        :string           not null
-#  created_at :datetime         not null
-#  updated_at :datetime         not null
+#  id           :bigint(8)        not null, primary key
+#  account_id   :bigint(8)
+#  uri          :string           not null
+#  created_at   :datetime         not null
+#  updated_at   :datetime         not null
+#  by_moderator :boolean
 #
 
 class Tombstone < ApplicationRecord