about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-06 13:54:32 +0200
committerGitHub <noreply@github.com>2019-07-06 13:54:32 +0200
commitae003d54f956fa2cbb422b04519b3a3e602652c3 (patch)
tree92a9cd8839ee109d696177c065d0513585c66353 /app
parented544f3166a2a726a22736ee53d43c29d0f44773 (diff)
Fix option to send e-mail notification about account action always being true (#11242)
Diffstat (limited to 'app')
-rw-r--r--app/models/admin/account_action.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/admin/account_action.rb b/app/models/admin/account_action.rb
index 84c3f880d..bdbd342fb 100644
--- a/app/models/admin/account_action.rb
+++ b/app/models/admin/account_action.rb
@@ -17,10 +17,13 @@ class Admin::AccountAction
                 :type,
                 :text,
                 :report_id,
-                :warning_preset_id,
-                :send_email_notification
+                :warning_preset_id
 
-  attr_reader :warning
+  attr_reader :warning, :send_email_notification
+
+  def send_email_notification=(value)
+    @send_email_notification = ActiveModel::Type::Boolean.new.cast(value)
+  end
 
   def save!
     ApplicationRecord.transaction do