Class: Decidim::Meetings::CloseMeetingForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Meetings::CloseMeetingForm
- Defined in:
- app/forms/decidim/meetings/close_meeting_form.rb
Overview
This class holds a Form to close a meeting from Decidim’s public views.
Instance Method Summary collapse
-
#map_model(model) ⇒ Object
Private: Gets the proposals from the meeting and injects them to the form.
- #proposals ⇒ Object
Instance Method Details
#map_model(model) ⇒ Object
Private: Gets the proposals from the meeting and injects them to the form.
Returns nothing.
17 18 19 20 21 |
# File 'app/forms/decidim/meetings/close_meeting_form.rb', line 17 def map_model(model) self.proposal_ids = model.linked_resources(:proposals, "proposals_from_meeting").pluck(:id) presenter = MeetingPresenter.new(model) self.closing_report = presenter.closing_report(all_locales: false) end |
#proposals ⇒ Object
23 24 25 26 27 28 |
# File 'app/forms/decidim/meetings/close_meeting_form.rb', line 23 def proposals @proposals ||= Decidim.find_resource_manifest(:proposals) .try(:resource_scope, current_component) &.where(id: proposal_ids) &.order(title: :asc) end |