Class: Decidim::Meetings::Admin::MeetingCopyForm

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

Overview

A form object used to copy a meeting from the admin dashboard.

Instance Method Summary collapse

Instance Method Details

#map_model(model) ⇒ Object



40
41
42
43
44
# File 'app/forms/decidim/meetings/admin/meeting_copy_form.rb', line 40

def map_model(model)
  self.services = model.services.map do |service|
    MeetingServiceForm.new(service)
  end
end

#number_of_servicesObject



50
51
52
# File 'app/forms/decidim/meetings/admin/meeting_copy_form.rb', line 50

def number_of_services
  services.size
end

#organizerObject



56
57
58
# File 'app/forms/decidim/meetings/admin/meeting_copy_form.rb', line 56

def organizer
  @organizer ||= current_organization.users.find_by(id: organizer_id)
end

#services_to_persistObject



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

def services_to_persist
  services.reject(&:deleted)
end