Class: Decidim::Meetings::Admin::MeetingCopyForm
- Inherits:
-
Form
- Object
- Form
- Decidim::Meetings::Admin::MeetingCopyForm
- 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
- #map_model(model) ⇒ Object
- #number_of_services ⇒ Object
- #organizer ⇒ Object
- #services_to_persist ⇒ Object
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_services ⇒ Object
50 51 52 |
# File 'app/forms/decidim/meetings/admin/meeting_copy_form.rb', line 50 def number_of_services services.size end |
#organizer ⇒ Object
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_persist ⇒ Object
46 47 48 |
# File 'app/forms/decidim/meetings/admin/meeting_copy_form.rb', line 46 def services_to_persist services.reject(&:deleted) end |