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

15 lines
363 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'active_storage/service/disk_service'
module ActiveStorage
class Service::CustomDiskService < Service::DiskService
def current_host
host = ActiveStorage::Current.host
host ||= Rails.application.secrets.mail_server_url
host = "http://#{host}" unless host.match?(/^http/)
host
end
end
end