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