Class: Decidim::Budgets::Admin::BudgetForm

Inherits:
Form
  • Object
show all
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

Instance Method Details

#decidim_scope_idObject

Scope identifier

Returns the scope identifier related to the meeting



33
34
35
# File 'app/forms/decidim/budgets/admin/budget_form.rb', line 33

def decidim_scope_id
  @decidim_scope_id || scope&.id
end

#scopeObject

Finds the Scope from the given decidim_scope_id, uses the compoenent scope if missing.

Returns a Decidim::Scope



26
27
28
# File 'app/forms/decidim/budgets/admin/budget_form.rb', line 26

def scope
  @scope ||= @decidim_scope_id ? current_component.scopes.find_by(id: @decidim_scope_id) : current_component.scope
end