Class: Decidim::Meetings::CloseMeetingReminderGenerator
- Inherits:
-
Object
- Object
- Decidim::Meetings::CloseMeetingReminderGenerator
- 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
-
#reminder_jobs_queued ⇒ Object
readonly
Returns the value of attribute reminder_jobs_queued.
Instance Method Summary collapse
-
#generate ⇒ Object
Creates reminders and updates them if they already exists.
-
#initialize ⇒ CloseMeetingReminderGenerator
constructor
A new instance of CloseMeetingReminderGenerator.
Constructor Details
#initialize ⇒ CloseMeetingReminderGenerator
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_queued ⇒ Object (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
#generate ⇒ Object
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 |