Class: Decidim::Conferences::Admin::ConferenceForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Conferences::Admin::ConferenceForm
- Includes:
- HasUploadValidations, TranslatableAttributes
- Defined in:
- app/forms/decidim/conferences/admin/conference_form.rb
Overview
A form object used to create conferences from the admin dashboard.
Instance Method Summary collapse
- #assemblies_for_select ⇒ Object
- #map_model(model) ⇒ Object
- #processes_for_select ⇒ Object
- #scope ⇒ Object
Instance Method Details
#assemblies_for_select ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 |
# File 'app/forms/decidim/conferences/admin/conference_form.rb', line 80 def assemblies_for_select return unless Decidim.participatory_space_manifests.map(&:name).include?(:assemblies) @assemblies_for_select ||= Decidim.find_participatory_space_manifest(:assemblies) .participatory_spaces.call(current_organization)&.order(title: :asc)&.map do |assembly| [ translated_attribute(assembly.title), assembly.id ] end end |
#map_model(model) ⇒ Object
60 61 62 |
# File 'app/forms/decidim/conferences/admin/conference_form.rb', line 60 def map_model(model) self.scope_id = model.decidim_scope_id end |
#processes_for_select ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 |
# File 'app/forms/decidim/conferences/admin/conference_form.rb', line 68 def processes_for_select return unless Decidim.participatory_space_manifests.map(&:name).include?(:participatory_processes) @processes_for_select ||= Decidim.find_participatory_space_manifest(:participatory_processes) .participatory_spaces.call(current_organization)&.order(title: :asc)&.map do |process| [ translated_attribute(process.title), process.id ] end end |
#scope ⇒ Object
64 65 66 |
# File 'app/forms/decidim/conferences/admin/conference_form.rb', line 64 def scope @scope ||= current_organization.scopes.find_by(id: scope_id) end |