Sha256: ade49b271f660fd7c325f6167679e4e389b982f25e451f56fb489f6050bc06fa

Contents?: true

Size: 634 Bytes

Versions: 46

Compression:

Stored size: 634 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # This command gets called when a content block is updated from the admin
    # panel.
    class UpdateHelpSections < Rectify::Command
      def initialize(form, organization)
        @form = form
        @organization = organization
      end

      def call
        return broadcast(:invalid) unless @form.valid?

        ActiveRecord::Base.transaction do
          @form.sections.each do |section|
            ContextualHelpSection.set_content(@organization, section.id, section.content)
          end
        end

        broadcast(:ok)
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-admin-0.26.10 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.9 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.8 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.7 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.5 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.4 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.3 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.0.rc2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.26.0.rc1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.0.rc4 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.0.rc3 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.0.rc2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.25.0.rc1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.3 app/commands/decidim/admin/update_help_sections.rb