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

Inherits:
Rectify::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

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

Instance Method Details

#callObject

Executes the command. Broadcasts these events:

  • :ok when everything is valid.

  • :invalid if the form wasn't valid and we couldn't 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