Class: Cron::TrimNotifications
- Inherits:
-
TrimCollection
- Object
- ActiveJob::Base
- ApplicationJob
- Job
- TrimCollection
- Cron::TrimNotifications
- Defined in:
- lib/app/jobs/cron/trim_notifications.rb
Overview
Trim notifications in system after 30 days.
This was historically done by a database index, however with the introduction of adding an email attachment, and thus another collection, this needed to move to a daily job here so that:
-
the object hierarchy is deleted
-
The paperclip call backs are fired to remove the file from S3
In case you are wondering why not make it an embedded class and allow the index method to still work, the answer is that it won’t clean up the S3 files.
Instance Method Summary collapse
-
#collection ⇒ Object
Return the collection.
Methods inherited from TrimCollection
#allowed_time, #allowed_time_for_item, #archive?, #perform, #trim_item
Methods inherited from Job
cron_tab_entry, #send_support_email
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
Instance Method Details
#collection ⇒ Object
Return the collection
20 21 22 |
# File 'lib/app/jobs/cron/trim_notifications.rb', line 20 def collection Notification.all end |