Sha256: 5473484c51520357a41813454fe34d28f010c54696f74b4bef8aaa7e421b65b4
Contents?: true
Size: 542 Bytes
Versions: 46
Compression:
Stored size: 542 Bytes
Contents
# frozen_string_literal: true module Decidim module Surveys # Command that gets called whenever a component's survey has to be created. It # usually happens as a callback when the component itself is created. class CreateSurvey < Rectify::Command def initialize(component) @component = component end def call @survey = Survey.new(component: @component, questionnaire: Decidim::Forms::Questionnaire.new) @survey.save ? broadcast(:ok) : broadcast(:invalid) end end end end
Version data entries
46 entries across 46 versions & 1 rubygems