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.23.6 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.5 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.0.rc2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.4 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.24.0.rc1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.3 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.2 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.1.rc1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.23.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.22.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.21.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.20.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.20.0 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.19.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.18.1 app/commands/decidim/admin/update_help_sections.rb
decidim-admin-0.19.0 app/commands/decidim/admin/update_help_sections.rb