Updated

app/jobs/archived / email_petitioners_job.rb

A
34 lines of codes
4 methods
2.9 complexity/method
1 churn
11.41 complexity
0 duplications
module Archived class EmailPetitionersJob < ApplicationJob
  1. Archived::EmailPetitionersJob has no descriptive comment
include EmailAllPetitionSignatories self.email_delivery_job_class = Archived::DeliverPetitionEmailJob self.timestamp_name = 'petition_email' attr_reader :email # It's likely that the email got deleted so we just log the error and move on rescue_from ActiveJob::DeserializationError do |exception| log_exception(exception) end def perform(**args) @email = args[:email] super end private def mailer_arguments(signature) super.merge(email: email) end def log_exception(exception) logger.info(log_message(exception)) end def log_message(exception) "#{exception.class.name} while running #{self.class.name}" end end end