diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-01-21 21:28:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-21 21:28:13 +0100 |
commit | 368d6fe54f94ad2ecd2a1c1e7e5a2359dc37ad30 (patch) | |
tree | 716c7c9a4e7f5717e982de3c67a462aa75d3aae4 /app/models | |
parent | c4a5e0ca0e89b2f8abd69ed9b8a4da3f82d0ccaf (diff) | |
parent | 3c76f1f6c2a95e80a02419b83478b89714a9d430 (diff) |
Merge pull request #2092 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
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 |