Class: LiabilityInsuranceWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Job
Defined in:
app/workers/liability_insurance_worker.rb

Overview

Sidekiq worker: liability insurance.

Instance Method Summary collapse

Instance Method Details

#performObject

Runs the job.

Returns:

  • (Object)

    the result



10
11
12
13
14
15
# File 'app/workers/liability_insurance_worker.rb', line 10

def perform
  # Mark active cards that have passed their expiration date as expired. The
  # customer-facing reminders and certification suspension are handled by
  # Certification::InsuranceEscalation (via CertificationCheckWorker).
  LiabilityInsurance.active.where(expiration_date: ...Time.current).find_each(&:expire!)
end