mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
14 lines
363 B
Ruby
14 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
|