Sha256: 67ff3df71e20f39a1b8f4c0083d926b6a58a4259712bae483657a26034ea17ce

Contents?: true

Size: 623 Bytes

Versions: 7

Compression:

Stored size: 623 Bytes

Contents

CarrierWave.configure do |config|
  config.storage = :file
  config.cache_dir = "#{Rails.root}/public/uploads/tmp"

  if Rails.env.test?
    config.cache_dir = "#{Rails.root}/public/uploads/tmp/test"
    config.enable_processing = false
  end

  if Rails.env.production? || Rails.env.staging?
    if ENV.has_key? "FOG_DIRECTORY"
      config.storage = :fog
      config.fog_directory = ENV.fetch("FOG_DIRECTORY")
      config.fog_credentials = {
        provider: "AWS",
        aws_access_key_id: ENV.fetch("AWS_ACCESS_KEY_ID"),
        aws_secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY"),
      }
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
venice-chr-0.1.5 config/initializers/carrierwave.rb
venice-chr-0.1.4 config/initializers/carrierwave.rb
chr-0.5.7 templates/carrierwave.rb
venice-chr-0.1.3 config/initializers/carrierwave.rb
venice-chr-0.1.2 config/initializers/carrierwave.rb
venice-chr-0.1.1 config/initializers/carrierwave.rb
chr-0.5.6 templates/carrierwave.rb