app/commands/decidim/assemblies/admin/update_assembly.rb in decidim-assemblies-0.24.3 vs app/commands/decidim/assemblies/admin/update_assembly.rb in decidim-assemblies-0.25.0.rc1
- old
+ new
@@ -4,10 +4,12 @@
module Assemblies
module Admin
# A command with all the business logic when creating a new participatory
# assembly in the system.
class UpdateAssembly < Rectify::Command
+ include ::Decidim::AttachmentAttributesMethods
+
# Public: Initializes the command.
#
# assembly - the Assembly to update
# form - A form object with the params.
def initialize(assembly, form)
@@ -93,20 +95,14 @@
twitter_handler: form.twitter_handler,
facebook_handler: form.facebook_handler,
instagram_handler: form.instagram_handler,
youtube_handler: form.youtube_handler,
github_handler: form.github_handler,
- weight: form.weight
- }.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) }
+ weight: form.weight,
+ announcement: form.announcement
+ }.merge(
+ attachment_attributes(:hero_image, :banner_image)
+ )
end
def participatory_processes(assembly)
@participatory_processes ||= assembly.participatory_space_sibling_scope(:participatory_processes).where(id: @form.participatory_processes_ids)
end