Created
September 30, 2015 10:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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