Skip to content

Instantly share code, notes, and snippets.

@mbutsko
Last active June 16, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbutsko/ffd8ac9ca2da9556c395bc83bfc77af0 to your computer and use it in GitHub Desktop.
Save mbutsko/ffd8ac9ca2da9556c395bc83bfc77af0 to your computer and use it in GitHub Desktop.
process_missed_sces.rb
def enqueue_missed_scheduled_closure_endorsements
sces = ScheduledClosureEndorsement.ready_for_batch_processing(due_date_range: (Date.new(2020, 5, 1)..Date.new(2020, 6, 13)))
raise "Wrong Count" unless sces.count == 510
sces.each do |sce|
next unless sce.policy_term == sce.policy_term.policy.active_term
ProcessClosureEndorsementJob.perform_later(scheduled_closure_endorsement_id: sce.id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment