Created
March 12, 2014 14:59
-
-
Save antillas21/9508695 to your computer and use it in GitHub Desktop.
Carrierwave initializer file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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