Sha256: 27e8943b59274fe1bdab674c87bf7e468bf04cd92fe32ae1e99f0b0e6c4e8e3a
Contents?: true
Size: 492 Bytes
Versions: 17
Compression:
Stored size: 492 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) @survey.save ? broadcast(:ok) : broadcast(:invalid) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems