Class: CleanJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- CleanJob
- Defined in:
- app/jobs/clean_job.rb
Overview
Instance Method Summary collapse
-
#perform(days: nil) ⇒ ARRAY, NIL
On perform, expired Happenings from an arbitrary days number are destroyed.
Instance Method Details
#perform(days: nil) ⇒ ARRAY, NIL
On perform, expired Happenings from an arbitrary days number are destroyed. On destroy each [Happening] destroy relative [Ticket]s
17 18 19 |
# File 'app/jobs/clean_job.rb', line 17 def perform(days: nil) Happening.where(start_at: [ ..Time.zone.now.to_date - days.to_i ]).destroy_all if days.present? end |