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