Class: Decidim::Proposals::CollaborativeDraftForm

Inherits:
ProposalForm show all
Defined in:
decidim-proposals/app/forms/decidim/proposals/collaborative_draft_form.rb

Overview

A form object to be used when public users want to create a Collaborative Draft.

Instance Method Summary collapse

Methods inherited from ProposalForm

#address, #category, #component_automatic_hashtags, #component_suggested_hashtags, #extra_hashtags, #geocoded?, #geocoding_enabled?, #has_address?, #scope, #scope_id, #suggested_hashtag_checked?, #suggested_hashtags

Methods included from TranslatableAttributes

#default_locale?

Instance Method Details

#map_model(model) ⇒ Object


7
8
9
10
11
12
13
# File 'decidim-proposals/app/forms/decidim/proposals/collaborative_draft_form.rb', line 7

def map_model(model)
  super

  return unless model.categorization

  self.category_id = model.categorization.decidim_category_id
end

#user_groupObject


15
16
17
# File 'decidim-proposals/app/forms/decidim/proposals/collaborative_draft_form.rb', line 15

def user_group
  @user_group ||= Decidim::UserGroup.find user_group_id if user_group_id.present?
end