Class: Decidim::Votings::Admin::DestroyMonitoringCommitteeMember

Inherits:
Command
  • Object
show all
Defined in:
decidim-elections/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb

Overview

A command with the business logic to destroy a monitoring committee member

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events

Constructor Details

#initialize(monitoring_committee_member, current_user) ⇒ DestroyMonitoringCommitteeMember

Public: Initializes the command.

monitoring_committee_member - the MonitoringCommitteeMember to destroy current_user - the user performing this action



12
13
14
15
# File 'decidim-elections/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb', line 12

def initialize(monitoring_committee_member, current_user)
  @monitoring_committee_member = monitoring_committee_member
  @current_user = current_user
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Method Details

#callObject

Executes the command. Broadcasts these events:

  • :ok when everything is valid.

  • :invalid if the form was not valid and we could not proceed.

Returns nothing.



23
24
25
26
# File 'decidim-elections/app/commands/decidim/votings/admin/destroy_monitoring_committee_member.rb', line 23

def call
  destroy_monitoring_committee_member!
  broadcast(:ok)
end