Sha256: ac11c906b9c5c9af89574405de51303d70770f859ba6bb647065f62ab3495d22
Contents?: true
Size: 1 KB
Versions: 94
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module Decidim module Proposals # A command with all the business logic when a user creates a new proposal. class CreateProposalExport < Rectify::Command # Public: Initializes the command. # # form - A form object with the params. # current_user - The current user. def initialize(participatory_process) @participatory_process = participatory_process end # Executes the command. Broadcasts these events: # # - :ok when everything is valid, together with the proposal. # - :invalid if the proposal wasn't valid and we couldn't proceed. # # Returns nothing. def call return broadcast(:invalid) if participatory_process.invalid? create_proposal_export broadcast(:ok, export) end private attr_reader :participatory_process def create_proposal_export ProposalsExporterJob.perform_later(participatory_process) end end end end
Version data entries
94 entries across 94 versions & 2 rubygems