Skip to content

Instantly share code, notes, and snippets.

@ivalentinee
Created September 30, 2015 10:55
Show Gist options
  • Save ivalentinee/fb389170f95da1729c44 to your computer and use it in GitHub Desktop.
Save ivalentinee/fb389170f95da1729c44 to your computer and use it in GitHub Desktop.
Fix CarrierWave to work with filenames (not files) for tests — doesn't pollute public/uploads folder
# Fix CarrierWave to work with filenames (not files)
module CarrierWave::Uploader::Cache
def cache!(filename)
@file = CarrierWave::SanitizedFile.new(File.open(filename))
@filename = filename
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment