app/commands/decidim/assemblies/admin/update_assembly.rb in decidim-assemblies-0.10.1 vs app/commands/decidim/assemblies/admin/update_assembly.rb in decidim-assemblies-0.11.0.pre1

- old
+ new

@@ -22,10 +22,11 @@ # # Returns nothing. def call return broadcast(:invalid) if form.invalid? update_assembly + link_participatory_processes(@assembly) if @assembly.valid? broadcast(:ok, @assembly) else form.errors.add(:hero_image, @assembly.errors[:hero_image]) if @assembly.errors.include? :hero_image @@ -66,17 +67,46 @@ description: form.description, short_description: form.short_description, scopes_enabled: form.scopes_enabled, scope: form.scope, area: form.area, + parent: form.parent, + private_space: form.private_space, developer_group: form.developer_group, local_area: form.local_area, target: form.target, participatory_scope: form.participatory_scope, participatory_structure: form.participatory_structure, meta_scope: form.meta_scope, - show_statistics: form.show_statistics + show_statistics: form.show_statistics, + purpose_of_action: form.purpose_of_action, + composition: form.composition, + assembly_type: form.assembly_type, + assembly_type_other: form.assembly_type_other, + creation_date: form.creation_date, + created_by: form.created_by, + created_by_other: form.created_by_other, + duration: form.duration, + included_at: form.included_at, + closing_date: form.closing_date, + closing_date_reason: form.closing_date_reason, + internal_organisation: form.internal_organisation, + is_transparent: form.is_transparent, + special_features: form.special_features, + 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 } + end + + def participatory_processes(assembly) + @participatory_processes ||= assembly.participatory_space_sibling_scope(:participatory_processes).where(id: @form.participatory_processes_ids) + end + + def link_participatory_processes(assembly) + assembly.link_participatory_spaces_resources(participatory_processes(assembly), "included_participatory_processes") end end end end end