docbrown/config/initializers/carrierwave_monkeypatch.rb
Ben Halpern f72eba0fe1
[deploy] Attempt to get carrierwave configured correctly for containers and tests passing (#9558)
* Attempt to get tests passing

* Hardcode region

* Move keys

* Add region vars back in

* S3DirectUpload

* Fix asset host

* Carrierwave monkeypatch

* Add condition

* remove require

* Move carrierwave monkeypatch to initializer

* Remove aws secret and key from path that doesn't need it

* Put keys back in

* File storage location ENV var

* Move carrierwave around

* Change to placeholder on jdoss track

* Use config region

* File store path

* Remove AWS keys

* Change logic slightly

* Uncomment production.rb code

* Adjust carrierwave

* Adjust carrierwave
2020-07-29 17:27:13 -04:00

17 lines
447 B
Ruby

# @forem/systems Force "public_url" even when fog_public is false via this monkeypatch
# Because we still want the "public" version path in all current scenarios.
if Rails.env.production? && ENV["HEROKU_APP_ID"].blank?
module CarrierWave
module Storage
class Fog < Abstract
class File
include CarrierWave::Utilities::Uri
def url
public_url
end
end
end
end
end
end