2012-03-15 15:00:29 -07:00
|
|
|
# By default, we'll have CarrierWave use S3 only on production. (Since each
|
|
|
|
# asset image has only One True Image no matter the environment, we'll override
|
|
|
|
# this to use S3 on all environments for those images only.)
|
|
|
|
|
|
|
|
CarrierWave.configure do |config|
|
2012-07-16 13:47:28 -07:00
|
|
|
if Rails.env.production?
|
2012-03-15 15:00:29 -07:00
|
|
|
config.storage = :fog
|
|
|
|
config.fog_credentials = {
|
|
|
|
:provider => 'AWS',
|
2015-07-17 15:26:43 -07:00
|
|
|
:aws_access_key_id => ENV.fetch('AWS_ACCESS_KEY_ID'),
|
|
|
|
:aws_secret_access_key => ENV.fetch('AWS_SECRET_ACCESS_KEY')
|
2012-03-15 15:00:29 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
config.storage = :file
|
|
|
|
end
|
|
|
|
end
|