Files
openfoodnetwork/app/jobs/application_job.rb
Maikel Linke 9f00817852 Use source of truth of url_options for report URLs
The ActionController options were not set in testing nor Sidekiq jobs.
The now used config is always set in config/application.rb.
2023-11-15 10:29:05 +01:00

18 lines
489 B
Ruby

# frozen_string_literal: true
# Rails standard class for common job code.
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
private
def enable_active_storage_urls
ActiveStorage::Current.url_options ||=
Rails.application.routes.default_url_options
end
end