diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-05-26 22:08:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 22:08:12 +0200 |
commit | 8a9acbe604667215c9589154d72b3f313755c210 (patch) | |
tree | 2e128f7b57ce84f7010ceaab0a8e1fe9226db82a | |
parent | c4d2c39a75eccdbc60c3540c259e1e7ea5881ac6 (diff) |
Fix being able to appeal a strike unlimited times (#18529)
Peculiarity of the `has_one` association is that the convenience creation method deletes the previous association even if the new one is invalid
-rw-r--r-- | app/services/appeal_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/appeal_service.rb b/app/services/appeal_service.rb index 1397c50f5..cef9be05f 100644 --- a/app/services/appeal_service.rb +++ b/app/services/appeal_service.rb @@ -14,7 +14,8 @@ class AppealService < BaseService private def create_appeal! - @appeal = @strike.create_appeal!( + @appeal = Appeal.create!( + strike: @strike, text: @text, account: @strike.target_account ) |