Class: Decidim::Proposals::ProposalForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Proposals::ProposalForm
- Defined in:
- decidim-proposals/app/forms/decidim/proposals/proposal_form.rb
Overview
A form object to be used when public users want to create a proposal.
Instance Method Summary collapse
-
#category ⇒ Object
Finds the Category from the category_id.
- #organization_scopes ⇒ Object
- #process_scope ⇒ Object
-
#scope ⇒ Object
Finds the Scope from the scope_id.
Instance Method Details
#category ⇒ Object
Finds the Category from the category_id.
Returns a Decidim::Category
40 41 42 |
# File 'decidim-proposals/app/forms/decidim/proposals/proposal_form.rb', line 40 def category @category ||= categories.where(id: category_id).first end |
#organization_scopes ⇒ Object
27 28 29 |
# File 'decidim-proposals/app/forms/decidim/proposals/proposal_form.rb', line 27 def organization_scopes current_organization.scopes end |
#process_scope ⇒ Object
31 32 33 |
# File 'decidim-proposals/app/forms/decidim/proposals/proposal_form.rb', line 31 def process_scope current_feature.participatory_process.scope end |
#scope ⇒ Object
Finds the Scope from the scope_id.
Returns a Decidim::Scope
47 48 49 |
# File 'decidim-proposals/app/forms/decidim/proposals/proposal_form.rb', line 47 def scope @scope ||= process_scope || organization_scopes.where(id: scope_id).first end |