Skip to content

Instantly share code, notes, and snippets.

@kzaitsev
Created August 28, 2014 08:02
Show Gist options
  • Save kzaitsev/c2ebf3377201ed51333b to your computer and use it in GitHub Desktop.
Save kzaitsev/c2ebf3377201ed51333b to your computer and use it in GitHub Desktop.
if ENV['RAILS_ENV'] == 'production'
puts "USING PATCHED CARRIERWAVE"
module CarrierWave
module Uploader
module Url
def url(options = {})
if file.respond_to?(:path)
path = encode_path(file.path.gsub(File.expand_path(root), ''))
"/#{path}"
else
"/not_found.png"
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment