scinote-web/lib/active_storage/service/custom_disk_service.rb

12 lines
343 B
Ruby

# frozen_string_literal: true
require 'active_storage/service/disk_service'
module ActiveStorage
class Service::CustomDiskService < Service::DiskService
def url_options
ActiveStorage::Current.url_options ||= { host: Rails.application.routes.default_url_options[:host] }
ActiveStorage::Current.url_options
end
end
end