Skip to content

Instantly share code, notes, and snippets.

@antillas21
Created March 12, 2014 14:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save antillas21/9508695 to your computer and use it in GitHub Desktop.
Carrierwave initializer file
if Rails.env.development?
CarrierWave.configure do |config|
config.storage = :file
end
elsif Rails.env.test?
CarrierWave.configure do |config|
config.storage = :file
config.enable_processing = false
end
else # production
CarrierWave.configure do |config|
config.storage = :fog
config.fog_credentials = {
:provider => 'AWS',
:aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
:path_style => true
}
config.fog_directory = ENV['FOG_DIRECTORY']
config.fog_public = false
config.fog_attributes = { 'Cache-Control' => 'max-age=315576000' }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment