Class: Decidim::Meetings::CloseMeetingForm
- Inherits:
-
Form
- Object
- AttributeObject::Form
- Form
- Decidim::Meetings::CloseMeetingForm
- Defined in:
- decidim-meetings/app/forms/decidim/meetings/close_meeting_form.rb
Overview
This class holds a Form to close a meeting from Decidim’s public views.
Constant Summary
Constants included from AttributeObject::TypeMap
AttributeObject::TypeMap::Boolean, AttributeObject::TypeMap::Decimal
Instance Attribute Summary
Attributes inherited from AttributeObject::Form
Instance Method Summary collapse
-
#map_model(model) ⇒ Object
Private: Gets the proposals from the meeting and injects them to the form.
- #proposals ⇒ Object
Methods inherited from AttributeObject::Form
ensure_hash, from_model, from_params, hash_from, infer_model_name, mimic, mimicked_model_name, model_name, #persisted?, #to_key, #to_model, #to_param, #valid?, #with_context
Methods included from AttributeObject::Model
#[], #[]=, #attributes, #attributes_with_values, #initialize, #to_h
Instance Method Details
#map_model(model) ⇒ Object
Private: Gets the proposals from the meeting and injects them to the form.
Returns nothing.
21 22 23 24 25 |
# File 'decidim-meetings/app/forms/decidim/meetings/close_meeting_form.rb', line 21 def map_model(model) self.proposal_ids = model.linked_resources(:proposals, "proposals_from_meeting").pluck(:id) presenter = MeetingEditionPresenter.new(model) self.closing_report = presenter.closing_report(all_locales: false) end |
#proposals ⇒ Object
27 28 29 30 31 32 |
# File 'decidim-meetings/app/forms/decidim/meetings/close_meeting_form.rb', line 27 def proposals @proposals = Decidim.find_resource_manifest(:proposals) .try(:resource_scope, current_component) &.where(id: proposal_ids) &.order(title: :asc) end |