Sha256: f7ddd5c0d4b45c02b1936b0703e3f3d53cfa911c889b48f7b80bf76b5c5f712b

Contents?: true

Size: 477 Bytes

Versions: 13

Compression:

Stored size: 477 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Templates
    module Admin
      # Creates a QuestionnaireTemplate.
      class CreateQuestionnaireTemplate < CreateTemplate
        protected

        def assign_template!
          @questionnaire = Decidim::Forms::Questionnaire.create!(questionnaire_for: @template)
          @template.update!(templatable: @questionnaire)
        end

        def target
          :questionnaire
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-templates-0.29.1 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.4 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.29.0 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.3 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.29.0.rc4 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.29.0.rc3 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.29.0.rc2 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.29.0.rc1 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.2 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.1 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.0 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.0.rc5 app/commands/decidim/templates/admin/create_questionnaire_template.rb
decidim-templates-0.28.0.rc4 app/commands/decidim/templates/admin/create_questionnaire_template.rb