about summary refs log tree commit diff
path: root/app/models/admin/account_action.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-15 20:45:27 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-03-15 20:45:27 +0100
commitc79a03b319e17f5ab8c40d065842607de0d76108 (patch)
tree71debfede36bf8985cd5e3e37b6107560c358f57 /app/models/admin/account_action.rb
parent80c4db160ecfd201cb82ed320cbe3eb32236ad20 (diff)
parente798c1c64cf417b88379e1d381592a8920fdeeab (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream changed their README, we have a completely different one.
  Kept our README.
Diffstat (limited to 'app/models/admin/account_action.rb')
-rw-r--r--app/models/admin/account_action.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb
index d3be4be3f..850ea6d82 100644
--- a/app/models/admin/account_action.rb
+++ b/app/models/admin/account_action.rb
@@ -22,6 +22,16 @@ class Admin::AccountAction
 
   attr_reader :warning, :send_email_notification, :include_statuses
 
+  alias send_email_notification? send_email_notification
+  alias include_statuses? include_statuses
+
+  def initialize(attributes = {})
+    @send_email_notification = true
+    @include_statuses        = true
+
+    super
+  end
+
   def send_email_notification=(value)
     @send_email_notification = ActiveModel::Type::Boolean.new.cast(value)
   end
@@ -141,11 +151,11 @@ class Admin::AccountAction
   end
 
   def warnable?
-    send_email_notification && target_account.local?
+    send_email_notification? && target_account.local?
   end
 
   def status_ids
-    report.status_ids if with_report? && include_statuses
+    report.status_ids if with_report? && include_statuses?
   end
 
   def reports