From 5f8e223e1bb1d9efcaf92b01c0685cf9ff11a71a Mon Sep 17 00:00:00 2001 From: takahashim Date: Fri, 22 Sep 2023 23:45:22 +0900 Subject: [PATCH] Update a form in v0.27.4 --- app/forms/decidim/debates/close_debate_form.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/forms/decidim/debates/close_debate_form.rb b/app/forms/decidim/debates/close_debate_form.rb index 8e632772cf..0faf04b2fb 100644 --- a/app/forms/decidim/debates/close_debate_form.rb +++ b/app/forms/decidim/debates/close_debate_form.rb @@ -7,7 +7,6 @@ class CloseDebateForm < Decidim::Form mimic :debate attribute :conclusions, Decidim::Attributes::CleanString - attribute :debate, Debate validates :debate, presence: true validates :conclusions, presence: true, length: { minimum: 10, maximum: 10_000 } @@ -19,7 +18,6 @@ def closed_at def map_model(debate) super - self.debate = debate # Debates can be translated in different languages from the admin but # the public form doesn't allow it. When a user closes a debate the @@ -31,6 +29,10 @@ def map_model(debate) end end + def debate + @debate ||= Debate.find_by(id: id) + end + private def user_can_close_debate