Last active
October 14, 2015 11:50
-
-
Save mdesanti/bc634f75d385819fb6b0 to your computer and use it in GitHub Desktop.
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
class PhotoUploader < CarrierWave::Uploader::Base | |
# Choose what kind of storage to use for this uploader: | |
storage :fog | |
# Override the directory where uploaded files will be stored. | |
# This is a sensible default for uploaders that are meant to be mounted: | |
def store_dir | |
if version_name == nil | |
"uploads/originals/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" | |
else | |
"uploads/resized/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" | |
end | |
end | |
version :resized, if: :never | |
def never(object) | |
false | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment