Class: Decidim::Proposals::Admin::ProposalForm

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

Overview

A form object to be used when admin users want to create a proposal.

Instance Method Summary collapse

Instance Method Details

#categoryObject

Finds the Category from the category_id.

Returns a Decidim::Category



38
39
40
# File 'app/forms/decidim/proposals/admin/proposal_form.rb', line 38

def category
  @category ||= categories.where(id: category_id).first
end

#organization_scopesObject



25
26
27
# File 'app/forms/decidim/proposals/admin/proposal_form.rb', line 25

def organization_scopes
  current_organization.scopes
end

#process_scopeObject



29
30
31
# File 'app/forms/decidim/proposals/admin/proposal_form.rb', line 29

def process_scope
  current_feature.participatory_process.scope
end

#scopeObject

Finds the Scope from the scope_id.

Returns a Decidim::Scope



45
46
47
# File 'app/forms/decidim/proposals/admin/proposal_form.rb', line 45

def scope
  @scope ||= process_scope || organization_scopes.where(id: scope_id).first
end