mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 21:56:12 +08:00
15 lines
363 B
Ruby
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
|