Updated

app/jobs / delete_petitions_job.rb

A
13 lines of codes
1 methods
5.8 complexity/method
2 churn
5.76 complexity
0 duplications
class DeletePetitionsJob < ApplicationJob
  1. DeletePetitionsJob has no descriptive comment
queue_as :high_priority def perform if Petition.unarchived.exists? raise RuntimeError, "Deleting petitions before they are archived will result in a loss of data" end Petition.find_each do |petition| DeletePetitionJob.perform_later(petition) end end end