demarches-normaliennes/app/uploaders/remote_downloader.rb

16 lines
269 B
Ruby
Raw Normal View History

class RemoteDownloader
def initialize(filename)
@filename = filename
end
def url
2018-08-22 17:36:15 +02:00
@url ||= File.join(base_url, CarrierWave::Uploader::Base.fog_directory, @filename)
end
protected
def base_url
Rails.application.secrets.fog[:base_url]
end
end