Sha256: 6920f330aa1cad7153870441449fb862bcbc65ae56ccc57b9ed53e2abee669c5

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

# frozen_string_literal: true

module Cybele
  module Helpers
    module ActiveStorage
      def active_storage_setting
        %w[
          config/environments/production.rb
          config/environments/staging.rb
        ].each do |file|
          gsub_file file,
                    /config.active_storage.service = :local/,
                    'config.active_storage.service = :amazon'
        end

        %w[.env.local .env.production .env.staging .env.sample].each do |env|
          append_file(env, template_content('active_storage/amazon_env_all.erb'))
        end

        inject_into_file 'config/storage.yml',
                         template_content('active_storage/active_storage.yml.erb'),
                         before: '# Use rails credentials:edit to set the AWS secrets'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cybele-2.3.2 lib/cybele/helpers/active_storage.rb
cybele-2.3.1 lib/cybele/helpers/active_storage.rb
cybele-2.2.0 lib/cybele/helpers/active_storage.rb