Class: Decidim::Proposals::Admin::ProposalForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Proposals::Admin::ProposalForm
- Defined in:
- decidim-proposals/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
-
#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
37 38 39 |
# File 'decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb', line 37 def category @category ||= categories.where(id: category_id).first end |
#organization_scopes ⇒ Object
24 25 26 |
# File 'decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb', line 24 def organization_scopes current_organization.scopes end |
#process_scope ⇒ Object
28 29 30 |
# File 'decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb', line 28 def process_scope current_feature.participatory_process.scope end |
#scope ⇒ Object
Finds the Scope from the scope_id.
Returns a Decidim::Scope
44 45 46 |
# File 'decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb', line 44 def scope @scope ||= process_scope || organization_scopes.where(id: scope_id).first end |