diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-01-21 14:58:15 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-01-21 14:58:15 +0100 |
commit | 3fd3e88b25f5007381948e3ca8596f13f62fbab4 (patch) | |
tree | a468dff85730cd9c53d39191f8522661055ae827 /app/models | |
parent | c4a5e0ca0e89b2f8abd69ed9b8a4da3f82d0ccaf (diff) | |
parent | a1abda39dd96c9415b46b799ce969cf7a5a1492a (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/account_warning.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/account_warning.rb b/app/models/account_warning.rb index 961a078b9..a181cd18d 100644 --- a/app/models/account_warning.rb +++ b/app/models/account_warning.rb @@ -26,6 +26,8 @@ class AccountWarning < ApplicationRecord suspend: 4_000, }, _suffix: :action + before_validation :before_validate + belongs_to :account, inverse_of: :account_warnings belongs_to :target_account, class_name: 'Account', inverse_of: :strikes belongs_to :report, optional: true @@ -47,4 +49,10 @@ class AccountWarning < ApplicationRecord def to_log_human_identifier target_account.acct end + + private + + def before_validate + self.text = '' if text.blank? + end end |