Class: Decidim::Meetings::Admin::UpdateRegistrations

Inherits:
Commands::UpdateResource
  • Object
show all
Defined in:
app/commands/decidim/meetings/admin/update_registrations.rb

Overview

This command is executed when the user updates the meeting registrations.

Instance Method Summary collapse

Instance Method Details

#run_after_hooksObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/commands/decidim/meetings/admin/update_registrations.rb', line 10

def run_after_hooks
  if resource.previous_changes["registrations_enabled"].present? && resource.registrations_enabled?
    Decidim::EventsManager.publish(
      event: "decidim.events.meetings.registrations_enabled",
      event_class: Decidim::Meetings::MeetingRegistrationsEnabledEvent,
      resource:,
      followers: resource.followers
    )
  end

  promote_from_waitlist!
end