Class: Decidim::Budgets::Admin::BudgetForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Budgets::Admin::BudgetForm
- Includes:
- TranslatableAttributes
- Defined in:
- app/forms/decidim/budgets/admin/budget_form.rb
Overview
This class holds a Form to create/update budgets from Decidim’s admin panel.
Instance Method Summary collapse
-
#decidim_scope_id ⇒ Object
Scope identifier.
-
#scope ⇒ Object
Finds the Scope from the given decidim_scope_id, uses the component scope if missing.
Instance Method Details
#decidim_scope_id ⇒ Object
Scope identifier
Returns the scope identifier related to the meeting
34 35 36 |
# File 'app/forms/decidim/budgets/admin/budget_form.rb', line 34 def decidim_scope_id super || scope&.id end |
#scope ⇒ Object
Finds the Scope from the given decidim_scope_id, uses the component scope if missing.
Returns a Decidim::Scope
27 28 29 |
# File 'app/forms/decidim/budgets/admin/budget_form.rb', line 27 def scope @scope ||= @attributes["decidim_scope_id"].value ? current_component.scopes.find_by(id: @attributes["decidim_scope_id"].value) : current_component.scope end |