Class: Decidim::Plans::Admin::PlanExportBudgetsForm

Inherits:
Form
  • Object
show all
Defined in:
app/forms/decidim/plans/admin/plan_export_budgets_form.rb

Overview

A form object to be used when admin users want to export a collection of plans into the budgeting projects component.

Instance Method Summary collapse

Instance Method Details

#target_componentObject



19
20
21
# File 'app/forms/decidim/plans/admin/plan_export_budgets_form.rb', line 19

def target_component
  @target_component ||= target_components.find_by(id: target_component_id)
end

#target_componentsObject



23
24
25
# File 'app/forms/decidim/plans/admin/plan_export_budgets_form.rb', line 23

def target_components
  @target_components ||= current_participatory_space.components.where(manifest_name: :budgets)
end

#target_components_collectionObject



27
28
29
30
31
# File 'app/forms/decidim/plans/admin/plan_export_budgets_form.rb', line 27

def target_components_collection
  target_components.map do |component|
    [component.name[I18n.locale.to_s], component.id]
  end
end