docbrown/config/initializers/carrierwave_monkeypatch.rb
Molly Struve a741dceace
Refactor:Implement Carrierwave Monkeypatch in all Envs (#11233)
* Refactor:Implement Carrierwave Monkeypatch for all Envs

* add a spec for monkey patch
2020-11-03 10:51:53 -06:00

17 lines
542 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.
# We also force this to use the SiteConfig instead of APP_DOMAIN because the value
# could change after initial boot.
module CarrierWave
module Storage
class Fog < Abstract
class File
include CarrierWave::Utilities::Uri
def url
public_url.gsub(ApplicationConfig["APP_DOMAIN"], SiteConfig.app_domain)
end
end
end
end
end