Class: Cron::Job
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- Cron::Job
- Defined in:
- lib/app/jobs/cron/job.rb
Overview
Base class for WeeklyJobs.
Support running only on certain days as defined by day_of_week method
Direct Known Subclasses
SwitchboardSyncConfiguration, SwitchboardSyncModels, TrimCollection
Class Method Summary collapse
-
.cron_tab_entry(entry) ⇒ Object
Method to set the cron_tab.
Instance Method Summary collapse
-
#send_support_email(error, event) ⇒ Object
Sends support an email if something goes awry.
Methods inherited from ApplicationJob
valid_environment?, valid_environments
Methods included from App47Logger
clean_params, #clean_params, delete_parameter_keys, #log_controller_error, log_debug, #log_debug, log_error, #log_error, log_exception, #log_message, log_message, #log_warn, log_warn, mask_parameter_keys, #update_flash_messages
Class Method Details
.cron_tab_entry(entry) ⇒ Object
Method to set the cron_tab
14 15 16 |
# File 'lib/app/jobs/cron/job.rb', line 14 def self.cron_tab_entry(entry) self.cron_tab = entry end |
Instance Method Details
#send_support_email(error, event) ⇒ Object
Sends support an email if something goes awry
21 22 23 24 25 26 27 28 29 |
# File 'lib/app/jobs/cron/job.rb', line 21 def send_support_email(error, event) email = EmailNotification.new email.to = '[email protected]' params = { current_date: I18n.l(Time.zone.today, format: :medium), event: event, error: error } email.from_template('support_ticket_notification', params) email.send_notification end |