Class: Decidim::Meetings::CloseMeetingReminderGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/decidim/meetings/close_meeting_reminder_generator.rb

Overview

This class is the generator class which creates and updates meetings related reminders, after reminder is generated it is send to user who have not closed past meetings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCloseMeetingReminderGenerator

Returns a new instance of CloseMeetingReminderGenerator.



10
11
12
13
# File 'app/services/decidim/meetings/close_meeting_reminder_generator.rb', line 10

def initialize
  @reminder_manifest = Decidim.reminders_registry.for(:close_meeting)
  @reminder_jobs_queued = 0
end

Instance Attribute Details

#reminder_jobs_queuedObject (readonly)

Returns the value of attribute reminder_jobs_queued.



8
9
10
# File 'app/services/decidim/meetings/close_meeting_reminder_generator.rb', line 8

def reminder_jobs_queued
  @reminder_jobs_queued
end

Instance Method Details

#generateObject

Creates reminders and updates them if they already exists.



16
17
18
19
20
# File 'app/services/decidim/meetings/close_meeting_reminder_generator.rb', line 16

def generate
  Decidim::Component.where(manifest_name: "meetings").published.each do |component|
    send_reminders(component)
  end
end