Sha256: 5b6da20e0f0ee776f97aa0781d5638b8b176f1d83ba3378e7a0e43fde5e7f5bb
Contents?: true
Size: 1.23 KB
Versions: 19
Compression:
Stored size: 1.23 KB
Contents
# frozen_string_literal: true module Decidim module Meetings module Admin # This command is executed when the user destroys a Meeting from the admin # panel. class DestroyMeeting < Rectify::Command # Initializes a CloseMeeting Command. # # meeting - The current instance of the page to be closed. # current_user - the user performing the action def initialize(meeting, current_user) @meeting = meeting @current_user = current_user end # Destroys the meeting if valid. # # Broadcasts :ok if successful, :invalid otherwise. def call return broadcast(:invalid, proposals.size) if proposals.any? destroy_meeting broadcast(:ok) end private attr_reader :current_user, :meeting def destroy_meeting Decidim.traceability.perform_action!( :delete, meeting, current_user ) do meeting.destroy! end end def proposals return [] unless Decidim::Meetings.enable_proposal_linking @proposals ||= meeting.authored_proposals.load end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems