Commit fb6a1d26

mo k <mo@mokhan.ca>
2012-12-06 13:50:13
add conditional to specify which target environment the imageuploader should pull resources from.
1 parent f7cc9d4
Changed files (1)
app
app/uploaders/image_uploader.rb
@@ -3,7 +3,15 @@ class ImageUploader < CarrierWave::Uploader::Base
   include CarrierWave::RMagick
   include CarrierWave::MimeTypes
 
-  storage :file
+  if Rails.env.production?
+    storage :fog
+  elsif Rails.env.staging?
+    storage :fog
+  elsif Rails.env.development?
+    storage :file
+  else
+    storage :file
+  end
 
   def store_dir
     "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"