app/commands/decidim/conferences/admin/update_conference.rb in decidim-conferences-0.24.3 vs app/commands/decidim/conferences/admin/update_conference.rb in decidim-conferences-0.25.0.rc1
- old
+ new
@@ -4,10 +4,12 @@
module Conferences
module Admin
# A command with all the business logic when creating a new participatory
# conference in the system.
class UpdateConference < Rectify::Command
+ include ::Decidim::AttachmentAttributesMethods
+
# Public: Initializes the command.
#
# conference - the Conference to update
# form - A form object with the params.
def initialize(conference, form)
@@ -83,19 +85,12 @@
end_date: form.end_date,
promoted: form.promoted,
scopes_enabled: form.scopes_enabled,
scope: form.scope,
show_statistics: form.show_statistics
- }.merge(uploader_attributes)
- end
-
- def uploader_attributes
- {
- hero_image: form.hero_image,
- remove_hero_image: form.remove_hero_image,
- banner_image: form.banner_image,
- remove_banner_image: form.remove_banner_image
- }.delete_if { |_k, val| val.is_a?(Decidim::ApplicationUploader) }
+ }.merge(
+ attachment_attributes(:hero_image, :banner_image)
+ )
end
def send_notification_registrations_enabled
Decidim::EventsManager.publish(
event: "decidim.events.conferences.registrations_enabled",