scinote-web/lib/active_storage/service/custom_disk_service.rb
2019-10-03 13:16:15 +02:00

15 lines
363 B
Ruby

# 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