Sha256: d06470adc17910257b72d6df1af7e1d1dbdb5f0ab72a881d1b1d99cb61f0bc88
Contents?: true
Size: 982 Bytes
Versions: 20
Compression:
Stored size: 982 Bytes
Contents
# frozen_string_literal: true module Decidim module Votings module Admin # This command is executed when the user destroys a polling station # from the admin panel. class DestroyPollingStation < Decidim::Command def initialize(polling_station, current_user) @polling_station = polling_station @current_user = current_user end # Destroys the polling station if valid. # # Broadcasts :ok if successful, :invalid otherwise. def call destroy_polling_station! broadcast(:ok, polling_station) end private attr_reader :polling_station, :current_user def destroy_polling_station! Decidim.traceability.perform_action!( :delete, polling_station, current_user, visibility: "all" ) do polling_station.destroy! end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems