Class: Decidim::Meetings::Admin::MeetingForm

Inherits:
Form
  • Object
show all
Includes:
TranslatableAttributes
Defined in:
decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb

Overview

This class holds a Form to create/update meetings from Decidim’s admin panel.

Instance Method Summary collapse

Methods inherited from Form

#available_locales

Instance Method Details

#categoryObject



51
52
53
54
# File 'decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb', line 51

def category
  return unless current_feature
  @category ||= current_feature.categories.where(id: decidim_category_id).first
end

#map_model(model) ⇒ Object



34
35
36
37
38
# File 'decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb', line 34

def map_model(model)
  return unless model.categorization

  self.decidim_category_id = model.categorization.decidim_category_id
end

#process_scopeObject



40
41
42
# File 'decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb', line 40

def process_scope
  current_feature.participatory_process.scope
end

#scopeObject



46
47
48
49
# File 'decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb', line 46

def scope
  return unless current_feature
  @scope ||= current_feature.scopes.where(id: decidim_scope_id).first || process_scope
end