Class: Decidim::Proposals::Admin::ProposalsMergeForm
- Inherits:
-
ProposalBaseForm
show all
- Includes:
- AttachmentAttributes, HasUploadValidations
- Defined in:
- app/forms/decidim/proposals/admin/proposals_merge_form.rb
Overview
A form object to be used when admin users wants to merge two or more proposals into a new one to another proposal component in the same space.
Instance Method Summary
collapse
#author, #geocoded?, #geocoding_enabled?, #has_address?, #map_model, #meeting_as_author, #meetings, #participatory_space_manifest
Instance Method Details
#proposals ⇒ Object
26
27
28
|
# File 'app/forms/decidim/proposals/admin/proposals_merge_form.rb', line 26
def proposals
@proposals ||= Decidim::Proposals::Proposal.where(component: current_component, id: proposal_ids).uniq
end
|
#same_component? ⇒ Boolean
36
37
38
|
# File 'app/forms/decidim/proposals/admin/proposals_merge_form.rb', line 36
def same_component?
target_component == current_component
end
|
#target_component ⇒ Object
30
31
32
33
34
|
# File 'app/forms/decidim/proposals/admin/proposals_merge_form.rb', line 30
def target_component
return current_component if clean_target_component_id == current_component.id
@target_component ||= current_component.siblings.find_by(id: target_component_id)
end
|