Class: Decidim::ParticipatoryDocuments::Admin::DocumentForm
- Inherits:
-
Form
- Object
- Form
- Decidim::ParticipatoryDocuments::Admin::DocumentForm
- Includes:
- HasUploadValidations, TranslatableAttributes
- Defined in:
- app/forms/decidim/participatory_documents/admin/document_form.rb
Instance Method Summary collapse
-
#map_model(doc) ⇒ Object
ensure color and opacity are present.
- #organization ⇒ Object
Instance Method Details
#map_model(doc) ⇒ Object
ensure color and opacity are present
26 27 28 29 |
# File 'app/forms/decidim/participatory_documents/admin/document_form.rb', line 26 def map_model(doc) self.box_color = doc.box_color.presence || "#1e98d7" self.box_opacity = doc.box_opacity.presence || 12 end |
#organization ⇒ Object
31 32 33 |
# File 'app/forms/decidim/participatory_documents/admin/document_form.rb', line 31 def organization attributes[:organization] || current_organization end |