Class: Decidim::Debates::Admin::DebateForm

Inherits:
Form
  • Object
show all
Includes:
AttachmentAttributes, HasTaxonomyFormAttributes, HasUploadValidations, TranslatableAttributes
Defined in:
app/forms/decidim/debates/admin/debate_form.rb

Overview

This class holds a Form to create/update debates from Decidim’s admin panel.

Instance Method Summary collapse

Instance Method Details

#map_model(model) ⇒ Object



38
39
40
41
42
43
44
45
46
# File 'app/forms/decidim/debates/admin/debate_form.rb', line 38

def map_model(model)
  self.finite = model.start_time.present? && model.end_time.present?
  presenter = DebatePresenter.new(model)

  self.title = presenter.title(all_locales: title.is_a?(Hash))
  self.description = presenter.description(all_locales: description.is_a?(Hash))
  self.comments_layout = model.comments_layout || "single_column"
  self.documents = model.attachments
end

#participatory_space_manifestObject



48
49
50
# File 'app/forms/decidim/debates/admin/debate_form.rb', line 48

def participatory_space_manifest
  @participatory_space_manifest ||= current_component.participatory_space.manifest.name
end