about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-07-31 01:25:10 -0500
committermultiple creatures <dev@multiple-creature.party>2019-07-31 01:25:10 -0500
commit80a81fe223415525811c0c3ef62b8853624e9a6a (patch)
treea5438b0d28dd9a872ad0223b2a130dee59ab92b7 /app/models
parent964054b6dbabf119c9dea9cfa0b71011ace8df07 (diff)
ability to add domain moderation notes, edit existing domain policies in-place, and process asynchronously
Diffstat (limited to 'app/models')
-rw-r--r--app/models/admin/action_log.rb2
-rw-r--r--app/models/domain_block.rb6
2 files changed, 7 insertions, 1 deletions
diff --git a/app/models/admin/action_log.rb b/app/models/admin/action_log.rb
index 1d1db1b7a..6794299de 100644
--- a/app/models/admin/action_log.rb
+++ b/app/models/admin/action_log.rb
@@ -34,7 +34,7 @@ class Admin::ActionLog < ApplicationRecord
     when :destroy, :create
       self.recorded_changes = target.attributes
     when :update, :promote, :demote
-      self.recorded_changes = target.previous_changes
+      self.recorded_changes = target_type != 'DomainBlock' ? target.previous_changes : target.attributes
     when :change_email
       self.recorded_changes = ActiveSupport::HashWithIndifferentAccess.new(
         email: [target.email, nil],
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb
index 486e2865b..e4baee5f0 100644
--- a/app/models/domain_block.rb
+++ b/app/models/domain_block.rb
@@ -11,6 +11,7 @@
 #  reject_media    :boolean          default(FALSE), not null
 #  reject_reports  :boolean          default(FALSE), not null
 #  force_sensitive :boolean          default(FALSE), not null
+#  reason          :text
 #
 
 class DomainBlock < ApplicationRecord
@@ -53,4 +54,9 @@ class DomainBlock < ApplicationRecord
     additionals << "reject reports" if reject_reports?
     additionals
   end
+
+  # workaround for the domain policy editor
+  def undo
+    return false
+  end
 end