Sha256: 7547c10b425dc94def87149618b578bd5547cc5f7d6a33885b890ffe516ccb16
Contents?: true
Size: 907 Bytes
Versions: 19
Compression:
Stored size: 907 Bytes
Contents
# frozen_string_literal: true module Decidim module Votings module Census module Admin # A command to launch the access codes export class LaunchAccessCodesExport < Rectify::Command def initialize(dataset, user) @dataset = dataset @user = user end # Executes the command. Broadcast this events: # - :ok when everything is valid # - :invalid when the user is not present # # Returns nothing. def call return broadcast(:invalid) unless valid? ExportAccessCodesJob.perform_later(dataset, user) broadcast(:ok) end attr_reader :user, :dataset private def valid? user.present? && dataset&.data&.present? && dataset.codes_generated? end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems