Move carrierwave storage config to initializer

openid
Marcin Kulik 12 years ago
parent 1fc49727b2
commit d72b5852e0

@ -7,7 +7,6 @@ class BasicUploader < CarrierWave::Uploader::Base
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage CFG['CARRIERWAVE_STORAGE']
# storage :fog
# Override the directory where uploaded files will be stored.

@ -1,5 +1,7 @@
if CFG['CARRIERWAVE_STORAGE'] == :fog
CarrierWave.configure do |config|
CarrierWave.configure do |config|
if CFG['CARRIERWAVE_STORAGE'] == :fog
config.storage = :fog
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => CFG['AWS_ACCESS_KEY_ID'],
@ -7,5 +9,12 @@ if CFG['CARRIERWAVE_STORAGE'] == :fog
:region => CFG['AWS_REGION']
}
config.fog_directory = CFG['AWS_BUCKET']
else
config.storage = :file
end
if Rails.env.test?
config.storage = :file
config.enable_processing = false
end
end

Loading…
Cancel
Save