From: Eugen Rochko Date: Thu, 26 May 2022 20:08:12 +0000 (+0200) Subject: Fix being able to appeal a strike unlimited times (#18529) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=bfc43e0b037aca8dd2474c06c1dbe73acd40ade3;p=mastodon.git 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 --- 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 )