2011-04-06 23:34:36 +00:00
|
|
|
CarrierWave.configure do |config|
|
|
|
|
|
|
|
|
config.cache_dir = File.join(Rails.root, 'tmp', 'uploads')
|
|
|
|
|
|
|
|
case Rails.env.to_sym
|
|
|
|
|
|
|
|
when :development
|
|
|
|
config.storage = :file
|
|
|
|
config.root = File.join(Rails.root, 'public')
|
|
|
|
|
|
|
|
when :production
|
2012-02-28 14:54:02 +00:00
|
|
|
# the following configuration works for Amazon S3
|
2012-03-02 00:46:02 +00:00
|
|
|
config.storage = :fog
|
|
|
|
config.fog_credentials = {
|
|
|
|
:provider => 'AWS',
|
|
|
|
:aws_access_key_id => ENV['S3_KEY_ID'],
|
|
|
|
:aws_secret_access_key => ENV['S3_SECRET_KEY'],
|
|
|
|
:region => 'us-east-1'
|
|
|
|
}
|
|
|
|
config.fog_directory = ENV['S3_BUCKET']
|
2011-08-11 21:47:12 +00:00
|
|
|
|
2012-02-07 10:17:56 +00:00
|
|
|
else
|
2011-08-11 21:47:12 +00:00
|
|
|
# settings for the local filesystem
|
2012-02-07 10:17:56 +00:00
|
|
|
config.storage = :file
|
|
|
|
config.root = File.join(Rails.root, 'public')
|
2011-04-06 23:34:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|